From a427b9da5e04263a8d373c7e8d55300edaf64666 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 26 Sep 2022 20:59:56 +0100 Subject: [PATCH] move s6-rc db creation to a module --- default.nix | 1 + make-image.nix | 6 ------ modules/s6-rc.nix | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 modules/s6-rc.nix diff --git a/default.nix b/default.nix index 6cdf809..85f6c72 100644 --- a/default.nix +++ b/default.nix @@ -8,6 +8,7 @@ let ./modules/base.nix ({ lib, ... } : { config = { inherit (device) kernel; }; }) + ./modules/s6-rc.nix ] nixpkgs.pkgs; finalConfig = config // { packages = (with nixpkgs.pkgs; [ s6-init-files s6-rc ]) ++ diff --git a/make-image.nix b/make-image.nix index ba4343a..17e2c9f 100644 --- a/make-image.nix +++ b/make-image.nix @@ -17,10 +17,6 @@ , writeText } : config : let - s6-rc-db = s6-rc-database.override { - services = builtins.attrValues config.services; - }; - pseudofiles = writeText "pseudofiles" '' / d 0755 0 0 /bin d 0755 0 0 @@ -42,8 +38,6 @@ let /bin/init s 0755 0 0 ${s6-init-bin}/bin/init /bin/sh s 0755 0 0 ${busybox}/bin/sh /bin/busybox s 0755 0 0 ${busybox}/bin/busybox - /etc/s6-rc d 0755 0 0 - /etc/s6-rc/compiled s 0755 0 0 ${s6-rc-db}/compiled /etc/passwd f 0644 0 0 echo "root::0:0:root:/:/bin/sh" ''; diff --git a/modules/s6-rc.nix b/modules/s6-rc.nix new file mode 100644 index 0000000..018db5b --- /dev/null +++ b/modules/s6-rc.nix @@ -0,0 +1,17 @@ +{ config, pkgs, ... }: +let + s6-rc-db = pkgs.s6-rc-database.override { + services = builtins.attrValues config.services; + }; + inherit (pkgs.pseudofile) dir symlink; +in { + config = { + environment = dir { + etc = dir { + s6-rc = dir { + compiled = symlink "${s6-rc-db}/compiled"; + }; + }; + }; + }; +}