also refactor nixos modules

This commit is contained in:
Chris Kruining 2026-03-30 09:32:15 +02:00
parent 2471562583
commit b37c5c0cbd
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
44 changed files with 10 additions and 2 deletions

100
modules/nixos/boot.nix Normal file
View file

@ -0,0 +1,100 @@
{
inputs,
lib,
config,
pkgs,
...
}: let
inherit (lib) mkIf mkMerge mkDefault mkOption;
inherit (lib.types) enum bool;
cfg = config.sneeuwvlok.boot;
in {
options.sneeuwvlok.boot = {
type = mkOption {
type = enum ["bios" "uefi"];
default = "uefi";
};
quiet = mkOption {
type = bool;
default = false;
};
animated = mkOption {
type = bool;
default = false;
};
};
config = mkMerge [
{
boot = {
kernelPackages = pkgs.linuxPackages_latest;
loader = {
systemd-boot.enable = false;
grub.enable = mkDefault true;
# grub2-theme = {
# enable = true;
# theme = "vimix";
# footer = true;
# };
};
supportedFilesystems = ["nfs"];
};
}
(mkIf (cfg.type == "bios") {
boot.loader.grub.efiSupport = false;
})
(mkIf (cfg.type == "uefi") {
boot.loader = {
efi.canTouchEfiVariables = true;
grub = {
efiSupport = true;
efiInstallAsRemovable = mkDefault false;
device = "nodev"; # INFO: https://discourse.nixos.org/t/question-about-grub-and-nodev
};
};
})
(mkIf cfg.quiet {
boot = {
consoleLogLevel = 0;
initrd = {
systemd.enable = true;
verbose = false;
};
kernelParams = [
"quiet"
"loglevel=3"
"systemd.show_status=auto"
"udev.log_level=3"
"rd.udev.log_level=3"
"vt.global_cursor_default=0"
];
loader.timeout = mkDefault 0;
};
})
(mkIf cfg.animated {
boot.plymouth = {
enable = true;
theme = mkDefault "pixels";
themePackages = with pkgs; [
(adi1090x-plymouth-themes.override {
selected_themes = ["pixels"];
})
];
};
})
];
}