Getting more idomatic nix modules setup... will tackle users dir later
This commit is contained in:
parent
6316fffeb1
commit
913cff0ffa
41 changed files with 675 additions and 498 deletions
31
modules/boot/grub.nix
Normal file
31
modules/boot/grub.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
name = "boot_grub";
|
||||
cfg = config.mods.${name};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
mods.${name} = {
|
||||
enable = mkEnableOption (lib.mdDoc "Enable ${name}");
|
||||
device = mkDefaultOption {
|
||||
type = types.str;
|
||||
default = "/dev/sda";
|
||||
description = ''
|
||||
The device to install GRUB on.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
device = cfg.device;
|
||||
};
|
||||
};
|
||||
}
|
31
modules/boot/systemd.nix
Normal file
31
modules/boot/systemd.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
name = "boot_systemd";
|
||||
cfg = config.mods.${name};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
mods.${name} = {
|
||||
enable = mkEnableOption (lib.mdDoc "Enable ${name}");
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
consoleMode = "keep";
|
||||
};
|
||||
timeout = 5;
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue