From e86daf9bbc5cd28ac514cdffc6c3fbd0a7ea8a05 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 28 Aug 2023 18:22:36 +0100 Subject: [PATCH] default value for services.default as a default default target, start all the services --- examples/rotuer.nix | 21 --------------------- modules/s6/default.nix | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/examples/rotuer.nix b/examples/rotuer.nix index 6b3abbe..2edabe9 100644 --- a/examples/rotuer.nix +++ b/examples/rotuer.nix @@ -201,27 +201,6 @@ in rec { dependencies = [ services.dhcp6 ]; }; - services.default = target { - name = "default"; - contents = with config.services; [ - config.hardware.networkInterfaces.lo - int - bridge - hostap - hostap5 - ntp - defaultroute4 - defaultroute6 - packet_forwarding - dns - resolvconf - sshd - config.services.hostname - dhcp6 - acquire-lan-prefix - acquire-wan-address - ]; - }; defaultProfile.packages = with pkgs; [ min-collect-garbage ]; diff --git a/modules/s6/default.nix b/modules/s6/default.nix index c62b510..46d88d0 100644 --- a/modules/s6/default.nix +++ b/modules/s6/default.nix @@ -7,10 +7,21 @@ let s6-linux-init stdenvNoCC; inherit (pkgs.pseudofile) dir symlink; + inherit (pkgs.liminix.services) bundle; - s6-rc-db = pkgs.s6-rc-database.override { - services = builtins.attrValues config.services; - }; + s6-rc-db = + let + defaultDefaultTarget = bundle { + name = "default"; + contents = builtins.attrValues config.services; + }; + servicesAttrs = { + default = defaultDefaultTarget; + } // config.services; + in + pkgs.s6-rc-database.override { + services = builtins.attrValues servicesAttrs; + }; s6-init-scripts = stdenvNoCC.mkDerivation { name = "s6-scripts"; src = ./scripts;