summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/gnu-store.mount.in3
-rw-r--r--etc/guix-daemon.service.in22
2 files changed, 21 insertions, 4 deletions
diff --git a/etc/gnu-store.mount.in b/etc/gnu-store.mount.in
index c94f2db72be..f9918c9e52e 100644
--- a/etc/gnu-store.mount.in
+++ b/etc/gnu-store.mount.in
@@ -2,10 +2,9 @@
2Description=Read-only @storedir@ for GNU Guix 2Description=Read-only @storedir@ for GNU Guix
3DefaultDependencies=no 3DefaultDependencies=no
4ConditionPathExists=@storedir@ 4ConditionPathExists=@storedir@
5Before=guix-daemon.service
6 5
7[Install] 6[Install]
8WantedBy=guix-daemon.service 7WantedBy=multi-user.target
9 8
10[Mount] 9[Mount]
11What=@storedir@ 10What=@storedir@
diff --git a/etc/guix-daemon.service.in b/etc/guix-daemon.service.in
index 5c43d9b7f1b..6a5ef97f9b3 100644
--- a/etc/guix-daemon.service.in
+++ b/etc/guix-daemon.service.in
@@ -5,11 +5,29 @@
5[Unit] 5[Unit]
6Description=Build daemon for GNU Guix 6Description=Build daemon for GNU Guix
7 7
8# Start before 'gnu-store.mount' to get a writable view of the store.
9Before=gnu-store.mount
10
8[Service] 11[Service]
9ExecStart=@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \ 12ExecStart=@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
10 --build-users-group=guixbuild --discover=no \ 13 --discover=no \
11 --substitute-urls='@GUIX_SUBSTITUTE_URLS@' 14 --substitute-urls='@GUIX_SUBSTITUTE_URLS@'
12Environment='GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale' LC_ALL=en_US.utf8 15Environment='GUIX_STATE_DIRECTORY=@localstatedir@/guix' 'GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale' LC_ALL=en_US.utf8
16
17# Run under a dedicated unprivileged user account.
18User=guix-daemon
19
20# Bind-mount the store read-write in a private namespace, to counter the
21# effect of 'gnu-store.mount'.
22PrivateMounts=true
23BindPaths=@storedir@
24
25# Provide the CAP_CHOWN capability so that guix-daemon can create and chown
26# /var/guix/profiles/per-user/$USER and also chown failed build directories
27# when using '--keep-failed'. Note that guix-daemon explicitly drops ambient
28# capabilities before executing build processes so they don't inherit them.
29AmbientCapabilities=CAP_CHOWN
30
13StandardOutput=journal 31StandardOutput=journal
14StandardError=journal 32StandardError=journal
15 33