Install systemd units

This commit is contained in:
Eelco Dolstra 2014-04-07 11:18:54 +02:00
parent 8e5fbf4d73
commit 84d6936371
7 changed files with 25 additions and 18 deletions

3
.gitignore vendored
View file

@ -108,6 +108,9 @@ Makefile.config
/perl/lib/Nix/Config.pm /perl/lib/Nix/Config.pm
/perl/lib/Nix/Store.cc /perl/lib/Nix/Store.cc
/misc/systemd/nix-daemon.service
/misc/systemd/nix-daemon.socket
*.a *.a
*.o *.o
*.so *.so

View file

@ -16,6 +16,7 @@ makefiles = \
perl/local.mk \ perl/local.mk \
scripts/local.mk \ scripts/local.mk \
corepkgs/local.mk \ corepkgs/local.mk \
misc/systemd/local.mk \
misc/emacs/local.mk \ misc/emacs/local.mk \
doc/manual/local.mk \ doc/manual/local.mk \
tests/local.mk tests/local.mk

1
misc/systemd/local.mk Normal file
View file

@ -0,0 +1 @@
$(foreach n, nix-daemon.socket nix-daemon.service, $(eval $(call install-file-in, $(d)/$(n), $(libdir)/systemd/system, 0644)))

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -132,14 +132,6 @@ done
# (until this is fixed in the relevant Makefile) # (until this is fixed in the relevant Makefile)
chmod -x $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/nix.sh chmod -x $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/nix.sh
# systemd not available on RHEL yet
%if ! 0%{?rhel}
# install systemd service descriptor
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system
cp -p misc/systemd/nix-daemon.service \
$RPM_BUILD_ROOT%{_prefix}/lib/systemd/system/
%endif
# Copy the byte-compiled mode file by hand # Copy the byte-compiled mode file by hand
cp -p misc/emacs/nix-mode.elc $RPM_BUILD_ROOT%{_emacs_sitelispdir}/ cp -p misc/emacs/nix-mode.elc $RPM_BUILD_ROOT%{_emacs_sitelispdir}/