aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-03-22 17:06:09 +0100
committerFlorian Klink <flokli@flokli.de>2022-03-23 13:51:38 +0100
commit67af5f7eda1dade544cc15397a7d0d35d0913cb2 (patch)
tree4d4a112894dfcaa7b354990c0aebca36f6f63a87
parentd60f3cf6e9c904912199ea64156fea295494430a (diff)
scripts/install-systemd-multi-user.sh: install /etc/tmpfiles.d/nix-daemon.conf, too
While `create_directories()` from install-multi-user.sh seems to already create parts of the directory structure, it's marked as deprecated, and it won't hurt also copying over the tmpfiles config and have it execute once.
-rwxr-xr-xscripts/install-systemd-multi-user.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/install-systemd-multi-user.sh b/scripts/install-systemd-multi-user.sh
index f4a2dfc5d..24884a023 100755
--- a/scripts/install-systemd-multi-user.sh
+++ b/scripts/install-systemd-multi-user.sh
@@ -9,6 +9,8 @@ readonly SERVICE_DEST=/etc/systemd/system/nix-daemon.service
readonly SOCKET_SRC=/lib/systemd/system/nix-daemon.socket
readonly SOCKET_DEST=/etc/systemd/system/nix-daemon.socket
+readonly TMPFILES_SRC=/lib/tmpfiles.d/nix-daemon.conf
+readonly TMPFILES_DEST=/etc/tmpfiles.d/nix-daemon.conf
# Path for the systemd override unit file to contain the proxy settings
readonly SERVICE_OVERRIDE=${SERVICE_DEST}.d/override.conf
@@ -83,6 +85,13 @@ EOF
poly_configure_nix_daemon_service() {
if [ -e /run/systemd/system ]; then
task "Setting up the nix-daemon systemd service"
+
+ _sudo "to create the nix-daemon tmpfiles config" \
+ ln -sfn /nix/var/nix/profiles/default/$TMPFILES_SRC $TMPFILES_DEST
+
+ _sudo "to run systemd-tmpfiles once to pick that path up" \
+ sytemd-tmpfiles create --prefix=/nix/var/nix
+
_sudo "to set up the nix-daemon service" \
systemctl link "/nix/var/nix/profiles/default$SERVICE_SRC"