refactor: change to litterate config
Configuration is now held by the `.org` files. All `.nix` files are tangled from the org-mode files.
This commit is contained in:
+16
-30
@@ -7,39 +7,25 @@
|
||||
with lib; let
|
||||
cfg = config.mySystem.boot;
|
||||
in {
|
||||
options.mySystem.boot = {
|
||||
systemd-boot = mkOption {
|
||||
type = types.bool;
|
||||
default = !cfg.grub.enable;
|
||||
description = "Does the system use systemd-boot?";
|
||||
};
|
||||
grub = {
|
||||
enable = mkEnableOption "Does the system use GRUB? (Disables systemd-boot)";
|
||||
device = mkOption {
|
||||
type = types.path;
|
||||
description = "The GRUB device";
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
zfs = {
|
||||
enable = mkEnableOption "Enables ZFS";
|
||||
pools = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
};
|
||||
options.mySystem.boot.systemd-boot = mkOption {
|
||||
type = types.bool;
|
||||
default = !cfg.grub.enable;
|
||||
description = "Does the system use systemd-boot?";
|
||||
};
|
||||
options.mySystem.boot.grub = {
|
||||
enable = mkEnableOption "Does the system use GRUB? (Disables systemd-boot)";
|
||||
device = mkOption {
|
||||
type = types.path;
|
||||
description = "The GRUB device";
|
||||
};
|
||||
};
|
||||
|
||||
config.boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = cfg.systemd-boot;
|
||||
efi.canTouchEfiVariables = cfg.systemd-boot;
|
||||
grub = mkIf cfg.grub.enable {
|
||||
inherit (cfg.grub) enable device;
|
||||
};
|
||||
};
|
||||
supportedFilesystems = mkIf cfg.zfs.enable ["zfs"];
|
||||
zfs.extraPools = mkIf cfg.zfs.enable cfg.zfs.pools;
|
||||
config.boot.loader = {
|
||||
systemd-boot.enable = cfg.systemd-boot;
|
||||
efi.canTouchEfiVariables = cfg.systemd-boot;
|
||||
};
|
||||
config.boot.loader.grub = mkIf cfg.grub.enable {
|
||||
inherit (cfg.grub) enable device;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user