♻️️ remove with lib; everywhere and partially switch to mkOpt

This commit is contained in:
Jo 2025-01-31 01:10:31 +01:00
parent c5283fe60b
commit 124d6b7ede
27 changed files with 72 additions and 53 deletions

View file

@ -3,8 +3,9 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.common.audio;
in {
options.${namespace}.common.audio = { enable = mkEnableOption "whether to enable common audio support and tweaks"; };

View file

@ -4,8 +4,9 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.common.bluetooth;
in {
options.${namespace}.common.bluetooth = { enable = mkEnableOption "Enable bluetooth support on your current system"; };

View file

@ -4,11 +4,12 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf mkOption;
cfg = config.${namespace}.common.fonts;
in {
options.${namespace}.common.fonts = with types; {
options.${namespace}.common.fonts = with lib.types; {
enable = mkEnableOption "Enable system font management";
fonts = mkOption {
type = listOf package;

View file

@ -3,8 +3,9 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.common.grub;
in {
options.${namespace}.common.grub = { enable = mkEnableOption "grub"; };

View file

@ -3,8 +3,9 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.common.hardware;
in {
options.${namespace}.common.hardware = { enable = mkEnableOption "whether to enable common hardware support"; };

View file

@ -4,18 +4,15 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.common.kernel;
in {
options.${namespace}.common.kernel = {
enable = mkEnableOption "Modify the standard kernel settings";
version = mkOption {
type = types.str;
default = "linuxPackages_latest";
example = "linuxPackages_latest";
description = "Set the kernel version to be used by your system";
};
version = mkOpt lib.types.str "linuxPackages_latest" "Set the kernel version to be used by your system";
};
config = mkIf cfg.enable {

View file

@ -3,29 +3,30 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf mkOption;
cfg = config.${namespace}.common.locale;
in {
options.${namespace}.common.locale = {
enable = mkEnableOption "whether to enable common locale tweaks";
language = mkOption {
type = types.str;
type = lib.types.str;
default = "en_US";
example = "en_US";
description = "Sets the language for most text, doesn't include monetary or measurement settings";
};
country = mkOption {
type = types.str;
type = lib.types.str;
default = "de_DE";
example = "de_DE";
description = "Sets the language used for monetary or measurement settings (USD vs Euro, etc...)";
};
keymap = mkOption {
type = types.str;
type = lib.types.str;
default = "de";
example = "de";
description = "Sets the keymap to be used by the system";

View file

@ -4,8 +4,9 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.common.nix;
in {
options.${namespace}.common.nix = {