refactor: split "real" modules and "config" modules

This commit is contained in:
oddlama 2024-05-25 17:56:30 +02:00
parent 045f15239a
commit cceae6c63c
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
60 changed files with 126 additions and 113 deletions

30
config/boot.nix Normal file
View file

@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf (!config.boot.isContainer) {
boot = {
initrd.systemd = {
enable = true;
emergencyAccess = config.repo.secrets.global.root.hashedPassword;
# TODO good idea? targets.emergency.wants = ["network.target" "sshd.service"];
extraBin.ip = "${pkgs.iproute2}/bin/ip";
extraBin.ping = "${pkgs.iputils}/bin/ping";
extraBin.cryptsetup = "${pkgs.cryptsetup}/bin/cryptsetup";
# Give me a usable shell please
users.root.shell = "${pkgs.bashInteractive}/bin/bash";
storePaths = ["${pkgs.bashInteractive}/bin/bash"];
};
# NOTE: Add "rd.systemd.unit=rescue.target" to debug initrd
kernelParams = ["log_buf_len=16M"]; # must be {power of two}[KMG]
tmp.useTmpfs = true;
loader.timeout = lib.mkDefault 2;
};
console.earlySetup = true;
};
}