os/modules/core/boot.nix

36 lines
770 B
Nix

{
config,
pkgs,
lib,
...
}:
let
cfg = config.pub-solar.core;
in {
options.pub-solar.core.disk-encryption-active = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether it should be assumed that there is a cryptroot device";
};
config = {
boot = {
# Mount / luks device in initrd
# Allow fstrim to work on it.
initrd = lib.mkIf cfg.disk-encryption-active {
luks.devices."cryptroot" = {
allowDiscards = true;
};
};
loader.systemd-boot.enable = lib.mkDefault true;
# Use latest LTS linux kernel by default
kernelPackages = lib.mkDefault pkgs.linuxPackages_testing;
# Support ntfs drives
supportedFilesystems = ["ntfs"];
};
};
}