From b7a6131732ac7c00318c661fb9cedbc46fcb9b22 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 28 Jul 2024 01:56:41 +0200 Subject: [PATCH] Add options for setting up windows --- lib/modules/valhalla.nix | 1 + lib/modules/windows.nix | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 lib/modules/windows.nix diff --git a/lib/modules/valhalla.nix b/lib/modules/valhalla.nix index 88edf140..e5d46b21 100644 --- a/lib/modules/valhalla.nix +++ b/lib/modules/valhalla.nix @@ -11,6 +11,7 @@ ./partition.nix ./software.nix ./users.nix + ./windows.nix ]; options = { diff --git a/lib/modules/windows.nix b/lib/modules/windows.nix new file mode 100644 index 00000000..4784c913 --- /dev/null +++ b/lib/modules/windows.nix @@ -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 = {}; + }; + }; + }; + }