aboutsummaryrefslogtreecommitdiff
path: root/nix/local.mk
diff options
context:
space:
mode:
authorMorgan Smith <Morgan.J.Smith@outlook.com>2020-09-17 13:03:09 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2020-09-17 14:10:42 +0200
commitcabac732deffafc796537658a6c33c6c4aec821e (patch)
tree98ec099c50b8b5dd1c6f682564fa239599c984ca /nix/local.mk
parentf72bafe32d539ddc4c53bc6ff5db04d3138ff818 (diff)
downloadguix-cabac732deffafc796537658a6c33c6c4aec821e.tar
guix-cabac732deffafc796537658a6c33c6c4aec821e.tar.gz
guix-install.sh: Support OpenRC.
* etc/guix-install.sh (chk_init_sys): Detect OpenRC. (sys_enable_guix_daemon): Install & enable the Guix daemon on such systems. * etc/openrc/guix-daemon.in: New file. * nix/local.mk: Add a rule for it. (openrcservicedir, nodist_openrcservice_DATA): New variables. (CLEANFILES, EXTRA_DIST): Add them. * .gitignore: Ignore etc/openrc/guix-daemon. Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
Diffstat (limited to 'nix/local.mk')
-rw-r--r--nix/local.mk17
1 files changed, 15 insertions, 2 deletions
diff --git a/nix/local.mk b/nix/local.mk
index 005cde5563..2bb01041b9 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -180,6 +180,17 @@ etc/init.d/guix-daemon: etc/init.d/guix-daemon.in \
"$<" > "$@.tmp"; \
mv "$@.tmp" "$@"
+# The service script for openrc.
+openrcservicedir = $(sysconfdir)/init.d
+nodist_openrcservice_DATA = etc/openrc/guix-daemon
+
+etc/openrc/guix-daemon: etc/openrc/guix-daemon.in \
+ $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
+ $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \
+ "$<" > "$@.tmp"; \
+ mv "$@.tmp" "$@"
+
# The '.conf' jobs for Upstart.
upstartjobdir = $(libdir)/upstart/system
nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf
@@ -194,7 +205,8 @@ etc/guix-%.conf: etc/guix-%.conf.in \
CLEANFILES += \
$(nodist_systemdservice_DATA) \
$(nodist_upstartjob_DATA) \
- $(nodist_sysvinitservice_DATA)
+ $(nodist_sysvinitservice_DATA) \
+ $(nodist_openrcservice_DATA)
EXTRA_DIST += \
%D%/AUTHORS \
@@ -203,7 +215,8 @@ EXTRA_DIST += \
etc/guix-daemon.conf.in \
etc/guix-publish.service.in \
etc/guix-publish.conf.in \
- etc/init.d/guix-daemon.in
+ etc/init.d/guix-daemon.in \
+ etc/openrc/guix-daemon.in
if CAN_RUN_TESTS