2022-09-14 20:24:11 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2023-06-27 12:12:59 +00:00
|
|
|
options.synit.logProgram = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
default = pkgs.writeScript "synit-log" ''
|
|
|
|
#!${pkgs.execline}/bin/execlineb -P
|
|
|
|
foreground { ${pkgs.coreutils}/bin/mkdir -p /var/log/synit }
|
|
|
|
${pkgs.s6}/bin/s6-log t /var/log/synit
|
|
|
|
'';
|
|
|
|
defaultText = "s6-log";
|
|
|
|
};
|
|
|
|
|
2022-09-14 20:24:11 +00:00
|
|
|
config = {
|
|
|
|
|
|
|
|
system.build.bootStage2 = lib.mkForce (pkgs.substituteAll {
|
|
|
|
src = ./stage-2-init.sh;
|
|
|
|
shellDebug = "${pkgs.bashInteractive}/bin/bash";
|
|
|
|
shell = "${pkgs.bash}/bin/bash";
|
|
|
|
isExecutable = true;
|
|
|
|
inherit (config.boot) readOnlyNixStore;
|
|
|
|
inherit (config.system.build) earlyMountScript;
|
2023-06-27 12:12:59 +00:00
|
|
|
path = lib.makeBinPath [ pkgs.busybox pkgs.eudev pkgs.mdevd pkgs.util-linux ];
|
2022-09-14 20:24:11 +00:00
|
|
|
inherit (pkgs) eudev;
|
|
|
|
synit_pid1 = "${pkgs.synit-pid1}/bin/synit-pid1";
|
2023-06-27 12:12:59 +00:00
|
|
|
inherit (config.synit) logProgram;
|
2022-09-14 20:24:11 +00:00
|
|
|
syndicate_server = "${pkgs.syndicate-server}/bin/syndicate-server";
|
|
|
|
|
|
|
|
postBootCommands = pkgs.writeText "local-cmds" ''
|
|
|
|
${config.boot.postBootCommands}
|
|
|
|
${config.powerManagement.powerUpCommands}
|
|
|
|
'';
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|