summary refs log tree commit diff
path: root/misc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-07 11:18:54 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-07 11:50:55 +0200
commit84d6936371037559704337614c65007a8e61b5e1 (patch)
treeeb21a77502e0c67d525128e74212606e11ce0ea5 /misc
parent8e5fbf4d730b9fcf39eddf5539a206cf19d2cdce (diff)
downloadguix-84d6936371037559704337614c65007a8e61b5e1.tar.gz
Install systemd units
Diffstat (limited to 'misc')
-rw-r--r--misc/systemd/local.mk1
-rw-r--r--misc/systemd/nix-daemon.service10
-rw-r--r--misc/systemd/nix-daemon.service.in9
-rw-r--r--misc/systemd/nix-daemon.socket.in11
4 files changed, 21 insertions, 10 deletions
diff --git a/misc/systemd/local.mk b/misc/systemd/local.mk
new file mode 100644
index 0000000000..a5f6131ce8
--- /dev/null
+++ b/misc/systemd/local.mk
@@ -0,0 +1 @@
+$(foreach n, nix-daemon.socket nix-daemon.service, $(eval $(call install-file-in, $(d)/$(n), $(libdir)/systemd/system, 0644)))
diff --git a/misc/systemd/nix-daemon.service b/misc/systemd/nix-daemon.service
deleted file mode 100644
index ee28209f09..0000000000
--- a/misc/systemd/nix-daemon.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Helper daemon for managing secure, multi-user Nix stores
-After=syslog.target
-
-[Service]
-Type=simple
-ExecStart=/usr/bin/nix-daemon
-
-[Install]
-WantedBy=multi-user.target
diff --git a/misc/systemd/nix-daemon.service.in b/misc/systemd/nix-daemon.service.in
new file mode 100644
index 0000000000..5fc04a3f57
--- /dev/null
+++ b/misc/systemd/nix-daemon.service.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Nix Daemon
+RequiresMountsFor=@storedir@
+RequiresMountsFor=@localstatedir@
+ConditionPathIsReadWrite=@localstatedir@/nix/daemon-socket
+
+[Service]
+ExecStart=@@bindir@/nix-daemon nix-daemon --daemon
+KillMode=process
diff --git a/misc/systemd/nix-daemon.socket.in b/misc/systemd/nix-daemon.socket.in
new file mode 100644
index 0000000000..9ed39ffe6e
--- /dev/null
+++ b/misc/systemd/nix-daemon.socket.in
@@ -0,0 +1,11 @@
+[Unit]
+Description=Nix Daemon Socket
+Before=multi-user.target
+RequiresMountsFor=@storedir@
+ConditionPathIsReadWrite=@localstatedir@/nix/daemon-socket
+
+[Socket]
+ListenStream=@localstatedir@/nix/daemon-socket/socket
+
+[Install]
+WantedBy=sockets.target