-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rxyhn
committed
Jan 6, 2024
1 parent
83c1ebf
commit 208b2a8
Showing
6 changed files
with
180 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: let | ||
cfg = config.modules.system.boot; | ||
in { | ||
options.modules.system.boot = { | ||
enable = lib.mkEnableOption "Custom boot configuration"; | ||
|
||
kernelModules = lib.mkOption { | ||
type = lib.types.listOf lib.types.str; | ||
description = "List of kernel modules to load at boot"; | ||
}; | ||
|
||
extraModulePackages = lib.mkOption { | ||
type = lib.types.listOf lib.types.package; | ||
description = "Extra kernel module packages"; | ||
}; | ||
|
||
initrdKernelModules = lib.mkOption { | ||
type = lib.types.listOf lib.types.str; | ||
description = "List of kernel modules for the initial ramdisk"; | ||
}; | ||
|
||
kernelPackages = lib.mkOption { | ||
type = lib.types.raw; | ||
description = "Kernel packages"; | ||
}; | ||
|
||
kernelParams = lib.mkOption { | ||
type = lib.types.listOf lib.types.str; | ||
description = "List of kernel parameters"; | ||
}; | ||
|
||
loader = { | ||
canTouchEfiVariables = lib.mkOption { | ||
type = lib.types.bool; | ||
default = true; | ||
description = "Whether the boot loader can modify EFI variables"; | ||
}; | ||
|
||
grub = lib.mkOption { | ||
type = lib.types.nullOr lib.types.attrs; | ||
default = null; | ||
description = "GRUB bootloader configuration"; | ||
}; | ||
|
||
systemdBoot = lib.mkOption { | ||
type = lib.types.nullOr lib.types.attrs; | ||
default = null; | ||
description = "systemd-boot bootloader configuration"; | ||
}; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
boot = { | ||
kernelModules = cfg.kernelModules; | ||
extraModulePackages = cfg.extraModulePackages; | ||
initrd.kernelModules = cfg.initrdKernelModules; | ||
kernelPackages = cfg.kernelPackages; | ||
kernelParams = cfg.kernelParams; | ||
|
||
loader = { | ||
efi.canTouchEfiVariables = cfg.loader.canTouchEfiVariables; | ||
grub = lib.optionalAttrs (cfg.loader.grub != null) cfg.loader.grub; | ||
systemd-boot = lib.optionalAttrs (cfg.loader.systemdBoot != null) cfg.loader.systemdBoot; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
imports = [ | ||
./boot.nix | ||
]; | ||
} |