Add options for setting up windows
This commit is contained in:
parent
1fb8c556e6
commit
3063ad189d
2 changed files with 38 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
|||
./partition.nix
|
||||
./software.nix
|
||||
./users.nix
|
||||
./windows.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
|
|
37
lib/modules/windows.nix
Normal file
37
lib/modules/windows.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
mkEnableOption
|
||||
mkIf
|
||||
types
|
||||
;
|
||||
|
||||
winType = types.submodule (
|
||||
{ config, ... }: {
|
||||
options = {
|
||||
dualboot = {
|
||||
enable = mkEnableOption "dual boot";
|
||||
|
||||
linuxPercentage = mkOption {
|
||||
type = types.number;
|
||||
description = "The percentage of the disk size reserved for Linux.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
dualboot.linuxPercentage = mkIf (!config.dualboot.enable) 0;
|
||||
};
|
||||
});
|
||||
in {
|
||||
options = {
|
||||
valhalla = {
|
||||
windows = mkOption {
|
||||
type = winType;
|
||||
description = "The options for setting up Windows.";
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue