WIP: feat(systemd): switch to systemd #33

Draft
lbailly wants to merge 8 commits from lbailly/liminix:systemd into main
7 changed files with 32 additions and 61 deletions
Showing only changes of commit ae78f9aafd - Show all commits

View file

@ -14,7 +14,7 @@ in
"${modulesPath}/busybox.nix" "${modulesPath}/busybox.nix"
"${modulesPath}/hostname.nix" "${modulesPath}/hostname.nix"
"${modulesPath}/kernel" "${modulesPath}/kernel"
"${modulesPath}/s6" "${modulesPath}/systemd"
"${modulesPath}/users.nix" "${modulesPath}/users.nix"
"${modulesPath}/outputs.nix" "${modulesPath}/outputs.nix"
"${modulesPath}/nixpkgs.nix" "${modulesPath}/nixpkgs.nix"

View file

@ -129,10 +129,9 @@ in {
# By default, we enable cross-compilation support. # By default, we enable cross-compilation support.
nixpkgs.buildPlatform = lib.mkDefault builtins.currentSystem; nixpkgs.buildPlatform = lib.mkDefault builtins.currentSystem;
defaultProfile.packages = with pkgs;
[ s6 s6-init-bin execline s6-linux-init s6-rc ];
# Set the useful PS1 prompt by default. # Set the useful PS1 prompt by default.
defaultProfile.environmentVariables.PS1 = lib.mkDefault config.defaultProfile.prompt; defaultProfile.environmentVariables.PS1 = lib.mkDefault config.defaultProfile.prompt;
defaultProfile.packages = with pkgs; [ execline ];
boot.commandLine = [ boot.commandLine = [
"panic=10 oops=panic init=/bin/init loglevel=8" "panic=10 oops=panic init=/bin/init loglevel=8"

View file

@ -1,19 +0,0 @@
#!/bin/sh
### Things to do before hardware halt/reboot/poweroff.
### Ideally, it should be a single call to the service manager,
### telling it to bring all the services down.
### If your s6-linux-init-maker invocation was made with the -1
### option, messages from rc.shutdown will appear on /dev/console
### as well as be logged by the catch-all logger.
### If your s6-linux-init-maker invocation did NOT include the -1
### option, messages from rc.shutdown will only be logged by the
### catch-all logger and will NOT appear on /dev/console. In order
### to print them to /dev/console instead, you may want to
### uncomment the following line:
exec >/dev/console 2>&1
### If your services are managed by s6-rc:
exec s6-rc -v2 -bDa change

View file

@ -1,22 +0,0 @@
#!/bin/sh -e
## s6-linux-init-shutdownd never tells s6-svscan to exit, so if
## you're running s6-linux-init, it's normal that your
## .s6-svscan/finish script is not executed.
## The place where you want to hack things is /etc/rc.shutdown.final,
## which is run by the stage 4 script right before the hard reboot.
## So you can do dirty stuff [...] which should clean up the
## s6-supervise and the foreground, and give control to
## .s6-svscan/finish.
## -- Laurent Bercot on skaware mailing list,
## https://skarnet.org/lists/skaware/1913.html
exec >/dev/console 2>&1
# down, exit supervisor, wait, stay down
s6-svc -dxwD /run/service/s6-linux-init-shutdownd
# HUP, exit supervisor, wait, down
s6-svc -hxwd /run/service/s6-svscan-log
s6-svscanctl -b /run/service # abort

View file

@ -1,12 +0,0 @@
#!/bin/sh -e
### This script is called once at boot time by rc.init, and is
### also called by the runleveld service every time the user
### requests a machine state change via telinit.
### Ideally, it should just be a call to the service manager.
test "$#" -gt 0 || { echo 'runlevel: fatal: too few arguments' 1>&2 ; exit 100 ; }
### If your services are managed by s6-rc:
exec s6-rc -v2 -up change "$1"

View file

@ -0,0 +1,25 @@
{ pkgs, ... }:
let
inherit (pkgs.pseudofile) dir symlink;
in
{
config = {
boot.commandLine = [
"systemd.log_level=7"
#"systemd.crash_shell=true"
];
filesystem = dir {
etc = dir {
systemd = dir {
"system.conf" = {
file = '''';
mode = "0444";
};
};
};
bin = dir {
init = symlink "${pkgs.systemd}/bin/init";
};
};
};
}

View file

@ -352,19 +352,19 @@ extraPkgs // {
withLibBPF = false; withLibBPF = false;
withLibidn2 = false; withLibidn2 = false;
withLocaled = false; withLocaled = false;
# withLogind = true; withLogind = false;
withMachined = false; withMachined = false;
# withNetworkd = true; withNetworkd = false;
withNss = false; withNss = false;
withOomd = false; withOomd = false;
# withPam = true; withPam = false;
# withPasswordQuality = true; withPasswordQuality = false;
withPCRE2 = false; withPCRE2 = false;
withPolkit = false; withPolkit = false;
withPortabled = false; withPortabled = false;
withQrencode = false; withQrencode = false;
withRemote = false; withRemote = false;
# withResolved = true; withResolved = false;
# withShellCompletions = true; # withShellCompletions = true;
# withSysusers = true; # withSysusers = true;
withSysupdate = false; withSysupdate = false;