♻️️ 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

@ -4,11 +4,10 @@
...
}:
let
inherit (lib) types;
inherit (lib.${namespace}) mkOpt;
in
{
options.${namespace}.admin = with types; {
options.${namespace}.admin = with lib.types; {
name = mkOpt str "Jo" "The short name of the system admin.";
full-name = mkOpt str "Johannes Reckers" "The full name of the system admin.";
email = mkOpt str "system@thevoid.cafe" "The E-Mail of the system admin. (Used for system services by default)";

View file

@ -3,8 +3,9 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.archetypes.server;
in {
options.${namespace}.archetypes.server = { enable = mkEnableOption "Enable the server archetype for your current system"; };

View file

@ -3,8 +3,9 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.archetypes.workstation;
in {
options.${namespace}.archetypes.workstation = { enable = mkEnableOption "Enable the workstation archetype for your current system"; };

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

View file

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

View file

@ -3,8 +3,9 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.desktop.plasma;
in {
options.${namespace}.desktop.plasma = { enable = mkEnableOption "Whether to enable the KDE Plasma desktop environment"; };
@ -17,4 +18,4 @@ in {
programs.kdeconnect.enable = true;
};
}
}

View file

@ -4,12 +4,13 @@
config,
namespace,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf mkOption;
cfg = config.${namespace}.security.yubikey;
in
{
options.${namespace}.security.yubikey = with types; {
options.${namespace}.security.yubikey = with lib.types; {
enable = mkEnableOption "Enable the Yubikey as a security device.";
key-id = mkOption {
type = listOf str;

View file

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

View file

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

View file

@ -4,9 +4,11 @@
config,
host,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.services.homepage;
homepageConfigDirectory = lib.snowfall.fs.get-file "resources/services/homepage";
in {
options.${namespace}.services.homepage = { enable = mkEnableOption "Enable Homepage, an intuitive dashboard for your services."; };

View file

@ -4,8 +4,9 @@
config,
host,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.services.sharkey;
in {
options.${namespace}.services.sharkey = { enable = mkEnableOption "Enable Sharkey, the activitypub-based microblogging service."; };

View file

@ -3,14 +3,15 @@
namespace,
config,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf mkOption;
cfg = config.${namespace}.services.traefik;
in {
options.${namespace}.services.traefik = {
enable = mkEnableOption "Enable the Traefik service.";
cloudflareEmail = mkOption {
type = types.str;
type = lib.types.str;
default = config.${namespace}.admin.email;
example = "system@thevoid.cafe";
description = "Specify the E-Mail associated with your Cloudflare account for ACME.";

View file

@ -4,8 +4,9 @@
config,
host,
...
}: with lib; with lib.${namespace};
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.services.vaultwarden;
in {
options.${namespace}.services.vaultwarden = { enable = mkEnableOption "Enable Vaultwarden, a self-hostable password manager."; };

View file

@ -3,9 +3,10 @@
pkgs,
namespace,
config,
...
}: with lib; with lib.${namespace};
...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.tools.cachix;
in {
options.${namespace}.tools.cachix = { enable = mkEnableOption "Enable the cachix binary cache service on your system."; };
@ -14,4 +15,3 @@ in {
environment.systemPackages = with pkgs; [ cachix ];
};
}