pub-solar-os/modules/x-os/boot.nix

32 lines
693 B
Nix
Raw Normal View History

2021-05-30 19:10:28 +00:00
{ config, pkgs, lib, ... }:
2021-10-24 20:03:28 +00:00
with lib;
2021-05-30 19:10:28 +00:00
let
cfg = config.pub-solar.x-os;
in
{
2021-10-25 23:06:13 +00:00
options.pub-solar.x-os.iso-options.enable = mkOption {
type = types.bool;
default = false;
description = "Feature flag for iso builds";
};
2021-05-30 19:10:28 +00:00
config = {
2022-05-01 15:29:21 +00:00
boot = {
# Enable plymouth for better experience of booting
plymouth.enable = true;
2021-05-30 19:10:28 +00:00
2022-05-01 15:29:21 +00:00
# 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;
};
2021-05-30 19:10:28 +00:00
};
2022-05-01 15:29:21 +00:00
resumeDevice = "/swapfile";
loader.systemd-boot.enable = true;
};
2021-05-30 19:10:28 +00:00
};
}