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, config,
... ...
}: let }: let
cfg = config.myFlake.darwin.networking.dns; cfg = config.myFlake.networking.dns;
in { in {
options = { options = {
myFlake.darwin.networking.dns = { myFlake.networking.dns = {
provider = lib.mkOption { provider = lib.mkOption {
type = lib.types.enum ["dhcp" "google" "alidns"]; type = lib.types.enum ["dhcp" "google" "alidns"];
default = default =

View file

@ -7,7 +7,7 @@
(modulesPath + "/installer/scan/not-detected.nix") # what is this (modulesPath + "/installer/scan/not-detected.nix") # what is this
]; ];
myFlake.nixos.hardware.components = { myFlake.hardware.components = {
cpu.intel.enable = true; cpu.intel.enable = true;
gpu.intel.enable = true; gpu.intel.enable = true;

View file

@ -3,10 +3,10 @@
lib, lib,
... ...
}: let }: let
cfg = config.myFlake.nixos.boot; cfg = config.myFlake.boot;
in { in {
options = { options = {
myFlake.nixos = { myFlake = {
boot = { boot = {
silentBoot = lib.mkEnableOption "Whether to enable silent boot."; silentBoot = lib.mkEnableOption "Whether to enable silent boot.";
noLoaderMenu = lib.mkEnableOption "Whether to disable bootloader menu."; noLoaderMenu = lib.mkEnableOption "Whether to disable bootloader menu.";

View file

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.accessories.logitech-wireless; cfg = config.myFlake.hardware.accessories.logitech-wireless;
in { in {
options = { options = {
myFlake.nixos.hardware.accessories.logitech-wireless.enable = myFlake.hardware.accessories.logitech-wireless.enable =
lib.mkEnableOption "Whether to enable support for wireless Logitech hardwares."; lib.mkEnableOption "Whether to enable support for wireless Logitech hardwares.";
}; };

View file

@ -4,10 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.accessories.piper; cfg = config.myFlake.hardware.accessories.piper;
in { in {
options = { options = {
myFlake.nixos.hardware.accessories.piper.enable = myFlake.hardware.accessories.piper.enable =
lib.mkEnableOption "Whether to enable Piper."; lib.mkEnableOption "Whether to enable Piper.";
}; };

View file

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.accessories.xboxOneController; cfg = config.myFlake.hardware.accessories.xboxOneController;
in { in {
options = { options = {
myFlake.nixos.hardware.accessories.xboxOneController.enable = myFlake.hardware.accessories.xboxOneController.enable =
lib.mkEnableOption "Whether to enable support for Xbox One controllers."; lib.mkEnableOption "Whether to enable support for Xbox One controllers.";
}; };

View file

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.components.cpu.intel; cfg = config.myFlake.hardware.components.cpu.intel;
in { in {
options = { 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 { config = lib.mkIf cfg.enable {

View file

@ -4,10 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.components.gpu.amd; cfg = config.myFlake.hardware.components.gpu.amd;
in { in {
options = { 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 # https://nixos.wiki/wiki/AMD_GPU

View file

@ -4,10 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.components.gpu.intel; cfg = config.myFlake.hardware.components.gpu.intel;
in { in {
options = { 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 # https://nixos.wiki/wiki/Intel_Graphics

View file

@ -3,11 +3,11 @@
config, config,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.components.gpu.nvidia; cfg = config.myFlake.hardware.components.gpu.nvidia;
in { in {
options = { options = {
myFlake.nixos.hardware.components.gpu.nvidia.enable = lib.mkEnableOption "Whether to enable NVIDIA GPU."; myFlake.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.prime = lib.mkEnableOption "Whether to enable NVIDIA Prime.";
}; };
# https://nixos.wiki/wiki/Nvidia # https://nixos.wiki/wiki/Nvidia

View file

@ -3,11 +3,11 @@
config, config,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.components.misc.audio; cfg = config.myFlake.hardware.components.misc.audio;
in { in {
options = { options = {
myFlake.nixos.hardware.components.misc.audio.enable = lib.mkEnableOption "Whether to enable audio."; myFlake.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.soundServer = lib.mkOption {
type = lib.types.enum ["pipewire" "pulseaudio"]; type = lib.types.enum ["pipewire" "pulseaudio"];
default = "pipewire"; default = "pipewire";
example = "pulseaudio"; example = "pulseaudio";

View file

@ -4,10 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.components.misc.bluetooth; cfg = config.myFlake.hardware.components.misc.bluetooth;
in { in {
options = { 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 # https://nixos.wiki/wiki/Bluetooth

View file

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.components.misc.fstrim; cfg = config.myFlake.hardware.components.misc.fstrim;
in { in {
options = { 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 { config = lib.mkIf cfg.enable {

View file

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myFlake.nixos.hardware.components.misc.tpm; cfg = config.myFlake.hardware.components.misc.tpm;
in { in {
options = { 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 # https://nixos.wiki/wiki/TPM

View file

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myFlake.nixos.networking.dns; cfg = config.myFlake.networking.dns;
in { in {
options = { options = {
myFlake.nixos.networking.dns = { myFlake.networking.dns = {
provider = lib.mkOption { provider = lib.mkOption {
type = lib.types.enum ["dhcp" "google" "alidns"]; type = lib.types.enum ["dhcp" "google" "alidns"];
default = default =

View file

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myFlake.nixos.networking; cfg = config.myFlake.networking;
in { in {
options = { options = {
myFlake.nixos = { myFlake = {
networking = { networking = {
network-configuration-daemon = lib.mkOption { network-configuration-daemon = lib.mkOption {
type = lib.types.enum ["iwd" "networkmanager" "networkmanager-iwd"]; type = lib.types.enum ["iwd" "networkmanager" "networkmanager-iwd"];

View file

@ -55,7 +55,7 @@
services = { services = {
getty.greetingLine = let getty.greetingLine = let
inherit (config.system) nixos; inherit (config.system) nixos;
inherit (config.myFlake.nixos.hardware.components) gpu; inherit (config.myFlake.hardware.components) gpu;
in '' in ''
NixOS ${nixos.label} ${nixos.codeName} (\m) - \l NixOS ${nixos.label} ${nixos.codeName} (\m) - \l
${lib.strings.optionalString gpu.nvidia.enable ${lib.strings.optionalString gpu.nvidia.enable

View file

@ -3,7 +3,7 @@
lib, lib,
... ...
}: { }: {
myFlake.nixos.hardware.accessories.xboxOneController.enable = lib.mkDefault true; myFlake.hardware.accessories.xboxOneController.enable = lib.mkDefault true;
programs.gamemode = { programs.gamemode = {
enable = true; enable = true;

View file

@ -15,6 +15,6 @@
}; };
### Options ### Options
myFlake.darwin.networking.dns.provider = lib.mkDefault "alidns"; myFlake.networking.dns.provider = lib.mkDefault "alidns";
home-manager.users.guanranwang = import ./home; home-manager.users.guanranwang = import ./home;
} }

View file

@ -4,7 +4,7 @@
... ...
}: { }: {
### Options ### Options
myFlake.nixos.boot.noLoaderMenu = lib.mkDefault true; myFlake.boot.noLoaderMenu = lib.mkDefault true;
### sops-nix ### sops-nix
sops.secrets."wireless/wangxiaobo".path = "/var/lib/iwd/wangxiaobo.psk"; sops.secrets."wireless/wangxiaobo".path = "/var/lib/iwd/wangxiaobo.psk";