treewide: shorten module option names

This commit is contained in:
Guanran Wang 2023-12-16 02:40:18 +08:00
parent 6515e77108
commit 74baa7b6bd
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
20 changed files with 37 additions and 37 deletions

View file

@ -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 =

View file

@ -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;

View file

@ -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.";

View file

@ -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.";
};

View file

@ -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.";
};

View file

@ -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.";
};

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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";

View file

@ -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

View file

@ -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 {

View file

@ -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

View file

@ -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 =

View file

@ -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"];

View file

@ -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

View file

@ -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;

View file

@ -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;
}

View file

@ -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";