From 4dc356752feb4a66def2127cbfe28d1f196a94fc Mon Sep 17 00:00:00 2001 From: twoneis Date: Sun, 21 Jul 2024 01:53:12 +0200 Subject: [PATCH] move to let inherit from with --- options.nix | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/options.nix b/options.nix index dfaf287..7c48d1b 100644 --- a/options.nix +++ b/options.nix @@ -1,35 +1,54 @@ { lib, ... }: { - options = with lib; { - user = mkEnableOption "Enable complete configuration for end-user machine"; + options = let + inherit (lib) mkOption mkEnableOption; + inherit (lib.types) nullOr str attrsOf; + in { + full = mkEnableOption "Enable complete configuration for end-user machine"; withNiri = mkEnableOption "Enable niri compositor"; withGnome = mkEnableOption "Enable Gnome"; - withVM = mkEnableOption "Enable VM related configuration"; + withVM = lib.mkEnableOption "Enable VM related configuration"; withContainers = mkEnableOption "Enable container support"; withGames = mkEnableOption "Enable games"; + withImpermanence = mkEnableOption "Use impermanence module"; + + disks = mkOption { + type = attrsOf str; + default = { + boot = ""; + crypt = ""; + root = ""; + }; + example = { + boot = "4672-C1A9"; + crypt = "747ae319-f189-44f5-9737-a42672e2c02d"; + root = "04255623-c061-4cf0-89fa-b3d8eb239d59"; + }; + }; + username = mkOption { - type = types.str; + type = str; default = "twoneis"; example = "anna"; }; hwmonPath = mkOption { - type = types.nullOr types.str; + type = nullOr str; default = null; example = "/sys/class/hwmon/hwmon1/temp1_input"; }; stateVersion = mkOption { - type = types.nullOr types.str; + type = nullOr str; default = null; example = "24.05"; }; hmStateVersion = mkOption { - type = types.nullOr types.str; + type = nullOr str; default = null; example = "24.11"; };