From 74baa7b6bd6233bb1072fcae400a28985c2dc7ad Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sat, 16 Dec 2023 02:40:18 +0800 Subject: [PATCH] treewide: shorten module option names --- darwin/modules/networking/dns.nix | 4 ++-- nixos/hardware/lenovo/legion/81fw/default.nix | 2 +- nixos/modules/boot/boot.nix | 4 ++-- nixos/modules/hardware/accessories/logitech-wireless.nix | 4 ++-- nixos/modules/hardware/accessories/piper.nix | 4 ++-- nixos/modules/hardware/accessories/xbox-one-controller.nix | 4 ++-- nixos/modules/hardware/components/cpu/intel.nix | 4 ++-- nixos/modules/hardware/components/gpu/amd.nix | 4 ++-- nixos/modules/hardware/components/gpu/intel.nix | 4 ++-- nixos/modules/hardware/components/gpu/nvidia.nix | 6 +++--- nixos/modules/hardware/components/misc/audio.nix | 6 +++--- nixos/modules/hardware/components/misc/bluetooth.nix | 4 ++-- nixos/modules/hardware/components/misc/fstrim.nix | 4 ++-- nixos/modules/hardware/components/misc/tpm.nix | 4 ++-- nixos/modules/networking/dns.nix | 4 ++-- nixos/modules/networking/network-configuration-daemon.nix | 4 ++-- nixos/profiles/core/default.nix | 2 +- nixos/profiles/opt-in/gaming.nix | 2 +- users/guanranwang/darwin/profiles/core/default.nix | 2 +- .../nixos/profiles/device-type/desktop/default.nix | 2 +- 20 files changed, 37 insertions(+), 37 deletions(-) diff --git a/darwin/modules/networking/dns.nix b/darwin/modules/networking/dns.nix index b9936bd..e59e788 100644 --- a/darwin/modules/networking/dns.nix +++ b/darwin/modules/networking/dns.nix @@ -3,10 +3,10 @@ config, ... }: let - cfg = config.myFlake.darwin.networking.dns; + cfg = config.myFlake.networking.dns; in { options = { - myFlake.darwin.networking.dns = { + myFlake.networking.dns = { provider = lib.mkOption { type = lib.types.enum ["dhcp" "google" "alidns"]; default = diff --git a/nixos/hardware/lenovo/legion/81fw/default.nix b/nixos/hardware/lenovo/legion/81fw/default.nix index 95666c4..8cb06a3 100644 --- a/nixos/hardware/lenovo/legion/81fw/default.nix +++ b/nixos/hardware/lenovo/legion/81fw/default.nix @@ -7,7 +7,7 @@ (modulesPath + "/installer/scan/not-detected.nix") # what is this ]; - myFlake.nixos.hardware.components = { + myFlake.hardware.components = { cpu.intel.enable = true; gpu.intel.enable = true; diff --git a/nixos/modules/boot/boot.nix b/nixos/modules/boot/boot.nix index b3d91eb..a21d0c0 100755 --- a/nixos/modules/boot/boot.nix +++ b/nixos/modules/boot/boot.nix @@ -3,10 +3,10 @@ lib, ... }: let - cfg = config.myFlake.nixos.boot; + cfg = config.myFlake.boot; in { options = { - myFlake.nixos = { + myFlake = { boot = { silentBoot = lib.mkEnableOption "Whether to enable silent boot."; noLoaderMenu = lib.mkEnableOption "Whether to disable bootloader menu."; diff --git a/nixos/modules/hardware/accessories/logitech-wireless.nix b/nixos/modules/hardware/accessories/logitech-wireless.nix index 7beab63..47e85e3 100644 --- a/nixos/modules/hardware/accessories/logitech-wireless.nix +++ b/nixos/modules/hardware/accessories/logitech-wireless.nix @@ -3,10 +3,10 @@ config, ... }: let - cfg = config.myFlake.nixos.hardware.accessories.logitech-wireless; + cfg = config.myFlake.hardware.accessories.logitech-wireless; in { options = { - myFlake.nixos.hardware.accessories.logitech-wireless.enable = + myFlake.hardware.accessories.logitech-wireless.enable = lib.mkEnableOption "Whether to enable support for wireless Logitech hardwares."; }; diff --git a/nixos/modules/hardware/accessories/piper.nix b/nixos/modules/hardware/accessories/piper.nix index d1f6b42..05b88ac 100644 --- a/nixos/modules/hardware/accessories/piper.nix +++ b/nixos/modules/hardware/accessories/piper.nix @@ -4,10 +4,10 @@ pkgs, ... }: let - cfg = config.myFlake.nixos.hardware.accessories.piper; + cfg = config.myFlake.hardware.accessories.piper; in { options = { - myFlake.nixos.hardware.accessories.piper.enable = + myFlake.hardware.accessories.piper.enable = lib.mkEnableOption "Whether to enable Piper."; }; diff --git a/nixos/modules/hardware/accessories/xbox-one-controller.nix b/nixos/modules/hardware/accessories/xbox-one-controller.nix index da7d848..07fb140 100644 --- a/nixos/modules/hardware/accessories/xbox-one-controller.nix +++ b/nixos/modules/hardware/accessories/xbox-one-controller.nix @@ -3,10 +3,10 @@ config, ... }: let - cfg = config.myFlake.nixos.hardware.accessories.xboxOneController; + cfg = config.myFlake.hardware.accessories.xboxOneController; in { options = { - myFlake.nixos.hardware.accessories.xboxOneController.enable = + myFlake.hardware.accessories.xboxOneController.enable = lib.mkEnableOption "Whether to enable support for Xbox One controllers."; }; diff --git a/nixos/modules/hardware/components/cpu/intel.nix b/nixos/modules/hardware/components/cpu/intel.nix index 3ab4d1c..8e4ed18 100755 --- a/nixos/modules/hardware/components/cpu/intel.nix +++ b/nixos/modules/hardware/components/cpu/intel.nix @@ -3,10 +3,10 @@ config, ... }: let - cfg = config.myFlake.nixos.hardware.components.cpu.intel; + cfg = config.myFlake.hardware.components.cpu.intel; in { options = { - myFlake.nixos.hardware.components.cpu.intel.enable = lib.mkEnableOption "Whether to enable Intel CPU."; + myFlake.hardware.components.cpu.intel.enable = lib.mkEnableOption "Whether to enable Intel CPU."; }; config = lib.mkIf cfg.enable { diff --git a/nixos/modules/hardware/components/gpu/amd.nix b/nixos/modules/hardware/components/gpu/amd.nix index c1c212c..21d7876 100644 --- a/nixos/modules/hardware/components/gpu/amd.nix +++ b/nixos/modules/hardware/components/gpu/amd.nix @@ -4,10 +4,10 @@ pkgs, ... }: let - cfg = config.myFlake.nixos.hardware.components.gpu.amd; + cfg = config.myFlake.hardware.components.gpu.amd; in { options = { - myFlake.nixos.hardware.components.gpu.amd.enable = lib.mkEnableOption "Whether to enable AMD GPU."; + myFlake.hardware.components.gpu.amd.enable = lib.mkEnableOption "Whether to enable AMD GPU."; }; # https://nixos.wiki/wiki/AMD_GPU diff --git a/nixos/modules/hardware/components/gpu/intel.nix b/nixos/modules/hardware/components/gpu/intel.nix index 7483a79..848092a 100644 --- a/nixos/modules/hardware/components/gpu/intel.nix +++ b/nixos/modules/hardware/components/gpu/intel.nix @@ -4,10 +4,10 @@ pkgs, ... }: let - cfg = config.myFlake.nixos.hardware.components.gpu.intel; + cfg = config.myFlake.hardware.components.gpu.intel; in { options = { - myFlake.nixos.hardware.components.gpu.intel.enable = lib.mkEnableOption "Whether to enable Intel GPU."; + myFlake.hardware.components.gpu.intel.enable = lib.mkEnableOption "Whether to enable Intel GPU."; }; # https://nixos.wiki/wiki/Intel_Graphics diff --git a/nixos/modules/hardware/components/gpu/nvidia.nix b/nixos/modules/hardware/components/gpu/nvidia.nix index 7fb8d83..f94857b 100755 --- a/nixos/modules/hardware/components/gpu/nvidia.nix +++ b/nixos/modules/hardware/components/gpu/nvidia.nix @@ -3,11 +3,11 @@ config, ... }: let - cfg = config.myFlake.nixos.hardware.components.gpu.nvidia; + cfg = config.myFlake.hardware.components.gpu.nvidia; in { options = { - myFlake.nixos.hardware.components.gpu.nvidia.enable = lib.mkEnableOption "Whether to enable NVIDIA GPU."; - myFlake.nixos.hardware.components.gpu.nvidia.prime = lib.mkEnableOption "Whether to enable NVIDIA Prime."; + myFlake.hardware.components.gpu.nvidia.enable = lib.mkEnableOption "Whether to enable NVIDIA GPU."; + myFlake.hardware.components.gpu.nvidia.prime = lib.mkEnableOption "Whether to enable NVIDIA Prime."; }; # https://nixos.wiki/wiki/Nvidia diff --git a/nixos/modules/hardware/components/misc/audio.nix b/nixos/modules/hardware/components/misc/audio.nix index 51ca106..4a73dc8 100755 --- a/nixos/modules/hardware/components/misc/audio.nix +++ b/nixos/modules/hardware/components/misc/audio.nix @@ -3,11 +3,11 @@ config, ... }: let - cfg = config.myFlake.nixos.hardware.components.misc.audio; + cfg = config.myFlake.hardware.components.misc.audio; in { options = { - myFlake.nixos.hardware.components.misc.audio.enable = lib.mkEnableOption "Whether to enable audio."; - myFlake.nixos.hardware.components.misc.audio.soundServer = lib.mkOption { + myFlake.hardware.components.misc.audio.enable = lib.mkEnableOption "Whether to enable audio."; + myFlake.hardware.components.misc.audio.soundServer = lib.mkOption { type = lib.types.enum ["pipewire" "pulseaudio"]; default = "pipewire"; example = "pulseaudio"; diff --git a/nixos/modules/hardware/components/misc/bluetooth.nix b/nixos/modules/hardware/components/misc/bluetooth.nix index 29d26d4..5c04796 100755 --- a/nixos/modules/hardware/components/misc/bluetooth.nix +++ b/nixos/modules/hardware/components/misc/bluetooth.nix @@ -4,10 +4,10 @@ pkgs, ... }: let - cfg = config.myFlake.nixos.hardware.components.misc.bluetooth; + cfg = config.myFlake.hardware.components.misc.bluetooth; in { options = { - myFlake.nixos.hardware.components.misc.bluetooth.enable = lib.mkEnableOption "Whether to enable bluetooth."; + myFlake.hardware.components.misc.bluetooth.enable = lib.mkEnableOption "Whether to enable bluetooth."; }; # https://nixos.wiki/wiki/Bluetooth diff --git a/nixos/modules/hardware/components/misc/fstrim.nix b/nixos/modules/hardware/components/misc/fstrim.nix index da84afe..82e2a23 100644 --- a/nixos/modules/hardware/components/misc/fstrim.nix +++ b/nixos/modules/hardware/components/misc/fstrim.nix @@ -3,10 +3,10 @@ config, ... }: let - cfg = config.myFlake.nixos.hardware.components.misc.fstrim; + cfg = config.myFlake.hardware.components.misc.fstrim; in { options = { - myFlake.nixos.hardware.components.misc.fstrim.enable = lib.mkEnableOption "Whether to enable SSD triming in background."; + myFlake.hardware.components.misc.fstrim.enable = lib.mkEnableOption "Whether to enable SSD triming in background."; }; config = lib.mkIf cfg.enable { diff --git a/nixos/modules/hardware/components/misc/tpm.nix b/nixos/modules/hardware/components/misc/tpm.nix index 4bfbe06..14bc344 100644 --- a/nixos/modules/hardware/components/misc/tpm.nix +++ b/nixos/modules/hardware/components/misc/tpm.nix @@ -3,10 +3,10 @@ config, ... }: let - cfg = config.myFlake.nixos.hardware.components.misc.tpm; + cfg = config.myFlake.hardware.components.misc.tpm; in { options = { - myFlake.nixos.hardware.components.misc.tpm.enable = lib.mkEnableOption "Whether to enable TPM."; + myFlake.hardware.components.misc.tpm.enable = lib.mkEnableOption "Whether to enable TPM."; }; # https://nixos.wiki/wiki/TPM diff --git a/nixos/modules/networking/dns.nix b/nixos/modules/networking/dns.nix index 517fc75..7e0d176 100644 --- a/nixos/modules/networking/dns.nix +++ b/nixos/modules/networking/dns.nix @@ -3,10 +3,10 @@ config, ... }: let - cfg = config.myFlake.nixos.networking.dns; + cfg = config.myFlake.networking.dns; in { options = { - myFlake.nixos.networking.dns = { + myFlake.networking.dns = { provider = lib.mkOption { type = lib.types.enum ["dhcp" "google" "alidns"]; default = diff --git a/nixos/modules/networking/network-configuration-daemon.nix b/nixos/modules/networking/network-configuration-daemon.nix index 41d4de7..49ecb22 100644 --- a/nixos/modules/networking/network-configuration-daemon.nix +++ b/nixos/modules/networking/network-configuration-daemon.nix @@ -3,10 +3,10 @@ config, ... }: let - cfg = config.myFlake.nixos.networking; + cfg = config.myFlake.networking; in { options = { - myFlake.nixos = { + myFlake = { networking = { network-configuration-daemon = lib.mkOption { type = lib.types.enum ["iwd" "networkmanager" "networkmanager-iwd"]; diff --git a/nixos/profiles/core/default.nix b/nixos/profiles/core/default.nix index acec9e8..ebdd218 100644 --- a/nixos/profiles/core/default.nix +++ b/nixos/profiles/core/default.nix @@ -55,7 +55,7 @@ services = { getty.greetingLine = let inherit (config.system) nixos; - inherit (config.myFlake.nixos.hardware.components) gpu; + inherit (config.myFlake.hardware.components) gpu; in '' NixOS ${nixos.label} ${nixos.codeName} (\m) - \l ${lib.strings.optionalString gpu.nvidia.enable diff --git a/nixos/profiles/opt-in/gaming.nix b/nixos/profiles/opt-in/gaming.nix index 1e32a9c..f607179 100644 --- a/nixos/profiles/opt-in/gaming.nix +++ b/nixos/profiles/opt-in/gaming.nix @@ -3,7 +3,7 @@ lib, ... }: { - myFlake.nixos.hardware.accessories.xboxOneController.enable = lib.mkDefault true; + myFlake.hardware.accessories.xboxOneController.enable = lib.mkDefault true; programs.gamemode = { enable = true; diff --git a/users/guanranwang/darwin/profiles/core/default.nix b/users/guanranwang/darwin/profiles/core/default.nix index 54ffa84..dd2f490 100644 --- a/users/guanranwang/darwin/profiles/core/default.nix +++ b/users/guanranwang/darwin/profiles/core/default.nix @@ -15,6 +15,6 @@ }; ### Options - myFlake.darwin.networking.dns.provider = lib.mkDefault "alidns"; + myFlake.networking.dns.provider = lib.mkDefault "alidns"; home-manager.users.guanranwang = import ./home; } diff --git a/users/guanranwang/nixos/profiles/device-type/desktop/default.nix b/users/guanranwang/nixos/profiles/device-type/desktop/default.nix index 1cce77e..202a51c 100644 --- a/users/guanranwang/nixos/profiles/device-type/desktop/default.nix +++ b/users/guanranwang/nixos/profiles/device-type/desktop/default.nix @@ -4,7 +4,7 @@ ... }: { ### Options - myFlake.nixos.boot.noLoaderMenu = lib.mkDefault true; + myFlake.boot.noLoaderMenu = lib.mkDefault true; ### sops-nix sops.secrets."wireless/wangxiaobo".path = "/var/lib/iwd/wangxiaobo.psk";