From 5d1791947464d0d4719cbb9aa3a56253c3d5d24e Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 27 Sep 2022 22:35:29 +0100 Subject: [PATCH] remove .service/.target/.bundle etc suffixes on service names they don't seem to be providing value --- THOUGHTS.txt | 6 ++++-- pkgs/liminix-tools/services/default.nix | 6 +++--- tests/smoke/run.sh | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/THOUGHTS.txt b/THOUGHTS.txt index b35f0444..dadc7d00 100644 --- a/THOUGHTS.txt +++ b/THOUGHTS.txt @@ -203,9 +203,11 @@ tools 15) "ip address add" seems to magically recognise v4 vs v6 but is that specified or fluke? -18) maybe stop suffixing all the service names with .service +DONE 18) maybe stop suffixing all the service names with .service + +19) syslogd - use busybox or s6? the only thing (so far) using it is pppd. +Maybe we could LD_PRELOAD it to use stderr instead -19) syslogd - use busybox or s6? DONE 20) The option currently called defaultPackages needs a better name as it doesn't have the same semantics as nixos diff --git a/pkgs/liminix-tools/services/default.nix b/pkgs/liminix-tools/services/default.nix index 30e332d4..265d5327 100644 --- a/pkgs/liminix-tools/services/default.nix +++ b/pkgs/liminix-tools/services/default.nix @@ -16,7 +16,7 @@ let , notification-fd ? null , dependencies ? [] } @ args: stdenvNoCC.mkDerivation { - name = "${name}.service"; + inherit name; serviceType = "longrun"; buildInputs = dependencies; dependencies = builtins.map (d: d.name) dependencies; @@ -35,7 +35,7 @@ let } @ args: stdenvNoCC.mkDerivation { # stdenvNoCC is to avoid generating derivations with names # like foo.service-mips-linux-musl - name = "${name}.service"; + inherit name; serviceType = "oneshot"; # does this suffice to make sure dependencies are included # even though the built output has no references to their @@ -62,7 +62,7 @@ let shell = "${busybox}/bin/sh"; builder = ./builder.sh; }; - bundle = { name, ... } @args : target (args // { name = "${name}.bundle";}); + bundle = { name, ... } @args : target (args // { inherit name;}); in { inherit target bundle oneshot longrun output; } diff --git a/tests/smoke/run.sh b/tests/smoke/run.sh index 4742a6ef..e8a6811b 100755 --- a/tests/smoke/run.sh +++ b/tests/smoke/run.sh @@ -13,10 +13,10 @@ cd $dest_path; db=nix/store/*-s6-rc-database/compiled/ test -d $db chmod -R +w $db -# check we have closure of config.services (lo.link.service exists only +# check we have closure of config.services (lo.link service exists only # as a dependency) -test "$(s6-rc-db -c $db type lo.link.service)" = "oneshot" -test "$(s6-rc-db -c $db type ntp.service)" = "longrun" +test "$(s6-rc-db -c $db type lo.link)" = "oneshot" +test "$(s6-rc-db -c $db type ntp)" = "longrun" echo OK EOF )