diff options
author | Florian Klink <flokli@flokli.de> | 2022-03-17 22:59:43 +0100 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2022-03-18 16:14:09 +0100 |
commit | d60f3cf6e9c904912199ea64156fea295494430a (patch) | |
tree | 9370c6d123a054157e8a93b0ac6c32523db8133b /misc/systemd/nix-daemon.conf.in | |
parent | 6afc3617982e872fac2142c3aeccd1e8482e7e52 (diff) |
nix-daemon.conf.in: add tmpfiles file to create nix/daemon-socket directory
nix-daemon.socket is used to socket-activate nix-daemon.service when
/nix/var/nix/daemon-socket/socket is accessed.
In container usecases, sometimes /nix/var/nix/daemon-socket is
bind-mounted read-only into the container.
In these cases, we want to skip starting nix-daemon.socket.
However, since systemd 250, `ConditionPathIsReadWrite` is also not met
if /nix/var/nix/daemon-socket doesn't exist at all. This means, a
regular NixOS system will skip starting nix-daemon.socket:
> [ 237.187747] systemd[1]: Nix Daemon Socket was skipped because of a failed condition check (ConditionPathIsReadWrite=/nix/var/nix/daemon-socket).
To prevent this from happening, ship a tmpfiles file that'll cause the
directory to be created if it doesn't exist already.
In the case of NixOS, we can just add Nix to `systemd.tmpfiles.packages`
and have these files picked up automatically.
Diffstat (limited to 'misc/systemd/nix-daemon.conf.in')
-rw-r--r-- | misc/systemd/nix-daemon.conf.in | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/misc/systemd/nix-daemon.conf.in b/misc/systemd/nix-daemon.conf.in new file mode 100644 index 000000000..e7b264234 --- /dev/null +++ b/misc/systemd/nix-daemon.conf.in @@ -0,0 +1 @@ +d @localstatedir@/nix/daemon-socket 0755 root root - - |