move s6-rc db creation to a module

module-based-network
Daniel Barlow 2022-09-26 20:59:56 +01:00
parent bd6cbd373f
commit a427b9da5e
3 changed files with 18 additions and 6 deletions

View File

@ -8,6 +8,7 @@ let
./modules/base.nix
({ lib, ... } : { config = { inherit (device) kernel; }; })
<liminix-config>
./modules/s6-rc.nix
] nixpkgs.pkgs;
finalConfig = config // {
packages = (with nixpkgs.pkgs; [ s6-init-files s6-rc ]) ++

View File

@ -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"
'';

17
modules/s6-rc.nix Normal file
View File

@ -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";
};
};
};
};
}