forked from pub-solar/os
36 lines
766 B
Nix
36 lines
766 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_6_6;
|
|
|
|
# Support ntfs drives
|
|
supportedFilesystems = ["ntfs"];
|
|
};
|
|
};
|
|
}
|