server10: initrd systemd

This commit is contained in:
Sandro - 2024-01-07 04:53:11 +01:00
parent ce83d387e2
commit fe4ba991a5
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
2 changed files with 26 additions and 14 deletions

View File

@ -13,6 +13,7 @@
}; };
boot = { boot = {
initrd.availableKernelModules = [ "e1000e" ];
loader.grub = lib.mkIf (!options?isoImage) { loader.grub = lib.mkIf (!options?isoImage) {
enable = true; enable = true;
device = "/dev/sda"; device = "/dev/sda";

View File

@ -15,7 +15,10 @@
]; ];
boot = { boot = {
initrd.network = { initrd = {
# make sure to set availableKernelModules otherwise it won't work!
# the module can be found in a booted system by running `dmesg | rg "Link"` and looking at the first word after the date
network = {
enable = true; enable = true;
ssh = { ssh = {
enable = true; enable = true;
@ -26,12 +29,20 @@
]; ];
port = 4748; port = 4748;
}; };
postCommands = '' postCommands = lib.mkIf (!config.boot.initrd.systemd.enable) ''
cat <<EOF > /root/.profile cat <<EOF > /root/.profile
cryptsetup-askpass cryptsetup-askpass
EOF EOF
''; '';
}; };
systemd = {
enable = true;
inherit (config.systemd) network;
contents."/etc/profile".text = ''
systemd-tty-ask-password-agent
'';
};
};
kernelParams = [ kernelParams = [
# "boot.shell_on_fail" # "boot.shell_on_fail"
"zfs_force=1" "zfs_force=1"