move to let inherit from with

This commit is contained in:
twoneis 2024-07-21 01:53:12 +02:00
parent aa3f6ada93
commit 4dc356752f

View file

@ -1,35 +1,54 @@
{ lib, ... }: { { lib, ... }: {
options = with lib; { options = let
user = mkEnableOption "Enable complete configuration for end-user machine"; 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"; withNiri = mkEnableOption "Enable niri compositor";
withGnome = mkEnableOption "Enable Gnome"; withGnome = mkEnableOption "Enable Gnome";
withVM = mkEnableOption "Enable VM related configuration"; withVM = lib.mkEnableOption "Enable VM related configuration";
withContainers = mkEnableOption "Enable container support"; withContainers = mkEnableOption "Enable container support";
withGames = mkEnableOption "Enable games"; 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 { username = mkOption {
type = types.str; type = str;
default = "twoneis"; default = "twoneis";
example = "anna"; example = "anna";
}; };
hwmonPath = mkOption { hwmonPath = mkOption {
type = types.nullOr types.str; type = nullOr str;
default = null; default = null;
example = "/sys/class/hwmon/hwmon1/temp1_input"; example = "/sys/class/hwmon/hwmon1/temp1_input";
}; };
stateVersion = mkOption { stateVersion = mkOption {
type = types.nullOr types.str; type = nullOr str;
default = null; default = null;
example = "24.05"; example = "24.05";
}; };
hmStateVersion = mkOption { hmStateVersion = mkOption {
type = types.nullOr types.str; type = nullOr str;
default = null; default = null;
example = "24.11"; example = "24.11";
}; };