GNU bug report logs -
#68589
[PATCH] Add guix-home-service-type
Previous Next
Reported by: Lars Rustand <rustand.lars <at> gmail.com>
Date: Fri, 19 Jan 2024 14:26:01 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Lars,
Lars Rustand <rustand.lars <at> gmail.com> skribis:
> Hoping to upstream this nice service from RDE. This service allows to
> embed a home environment in a operating-system declaration.
>
> Original source: https://git.sr.ht/~abcdw/rde/tree/master/item/src/gnu/services/home.scm
>
> Change-Id: I42976cae9dd1580dc07dc866cd851294c7921725
This would be much welcome!
> +++ b/gnu/services/home.scm
> @@ -0,0 +1,47 @@
> +(define-module (gnu services home)
Could you add a header similar to that found in other files?
Since this is copied from rde, make sure to preserve their copyright
notices.
> +(define (guix-home-shepherd-service config)
> + (map
> + (lambda (x)
> + (let ((user (car x))
> + (he (cdr x)))
In Guix we’d use ‘match’ instead of ‘car’ + ‘cdr’:
https://guix.gnu.org/manual/devel/en/html_node/Data-Types-and-Pattern-Matching.html
But perhaps we could just as well define a <guix-home-configuration>
record or similar?
> +(define (guix-home-gc-roots config)
> + (map cdr config))
Unused.
> +(define guix-home-service-type
> + (service-type
> + (name 'guix-home)
> + (description "Setups home-environments specified in the value.")
“Sets up Guix Home for the specified user accounts.”
> + (extensions (list (service-extension
> + shepherd-root-service-type
> + guix-home-shepherd-service)))
> + ;; (compose append)
> + ;; (extend append)
Why comment it out?
Also make sure to register the file in ‘gnu/local.mk’.
Last, we usually require a test for system services; you can find them
in gnu/tests/*.scm. Could you try and write one? It would check for
instance that the user’s shepherd is indeed started.
Could you send an updated patch?
Thanks,
Ludo’.
This bug report was last modified 1 year and 25 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.