os/modules/x-os/boot.nix

32 lines
693 B
Nix

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.pub-solar.x-os;
in
{
options.pub-solar.x-os.iso-options.enable = mkOption {
type = types.bool;
default = false;
description = "Feature flag for iso builds";
};
config = {
boot = {
# Enable plymouth for better experience of booting
plymouth.enable = true;
# Mount / luks device in initrd
# Allow fstrim to work on it.
# The ! makes this enabled by default
initrd = mkIf (!cfg.iso-options.enable) {
luks.devices."cryptroot" = {
allowDiscards = true;
};
};
resumeDevice = "/swapfile";
loader.systemd-boot.enable = true;
};
};
}