treewide: remove 'with lib;'

This commit is contained in:
Felix Buehler 2025-09-21 18:40:36 +02:00
parent cf54323dc7
commit 78ae241387
53 changed files with 245 additions and 245 deletions

View file

@ -8,8 +8,8 @@ let
cfg = config.my.hardware.bluetooth; cfg = config.my.hardware.bluetooth;
in in
{ {
options.my.hardware.bluetooth = with lib; { options.my.hardware.bluetooth = {
enable = mkEnableOption "bluetooth configuration"; enable = lib.mkEnableOption "bluetooth configuration";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -8,8 +8,8 @@ let
cfg = config.my.hardware.debug; cfg = config.my.hardware.debug;
in in
{ {
options.my.hardware.debug = with lib; { options.my.hardware.debug = {
enable = mkEnableOption "hardware-debug configuration"; enable = lib.mkEnableOption "hardware-debug configuration";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -3,11 +3,11 @@ let
cfg = config.my.hardware.drive-monitor; cfg = config.my.hardware.drive-monitor;
in in
{ {
options.my.hardware.drive-monitor = with lib; { options.my.hardware.drive-monitor = {
enable = mkEnableOption "drive-monitor configuration"; enable = lib.mkEnableOption "drive-monitor configuration";
OnFailureMail = mkOption { OnFailureMail = lib.mkOption {
type = types.nullOr types.str; type = lib.types.nullOr lib.types.str;
description = "Mail address where to send the error report"; description = "Mail address where to send the error report";
default = null; default = null;
example = "alarm@mail.com"; example = "alarm@mail.com";

View file

@ -3,16 +3,16 @@ let
cfg = config.my.hardware.firmware; cfg = config.my.hardware.firmware;
in in
{ {
options.my.hardware.firmware = with lib; { options.my.hardware.firmware = {
enable = mkEnableOption "firmware configuration"; enable = lib.mkEnableOption "firmware configuration";
cpuFlavor = mkOption { cpuFlavor = lib.mkOption {
type = type = lib.types.nullOr (
with types; lib.types.enum [
nullOr (enum [
"intel" "intel"
"amd" "amd"
]); ]
);
default = null; default = null;
example = "intel"; example = "intel";
description = "Which kind of CPU to activate micro-code updates"; description = "Which kind of CPU to activate micro-code updates";

View file

@ -8,15 +8,15 @@ let
cfg = config.my.hardware.graphics; cfg = config.my.hardware.graphics;
in in
{ {
options.my.hardware.graphics = with lib; { options.my.hardware.graphics = {
enable = mkEnableOption "graphics configuration"; enable = lib.mkEnableOption "graphics configuration";
cpuFlavor = mkOption { cpuFlavor = lib.mkOption {
type = type = lib.types.nullOr (
with types; lib.types.enum [
nullOr (enum [
"amd" "amd"
"intel" "intel"
]); ]
);
default = null; default = null;
example = "intel"; example = "intel";
description = "Which kind of GPU"; description = "Which kind of GPU";

View file

@ -3,8 +3,8 @@ let
cfg = config.my.hardware.id-card; cfg = config.my.hardware.id-card;
in in
{ {
options.my.hardware.id-card = with lib; { options.my.hardware.id-card = {
enable = mkEnableOption "german id card authentication"; enable = lib.mkEnableOption "german id card authentication";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -5,11 +5,11 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.acme = with lib; { options.my.services.acme = {
enable = mkEnableOption "ACME certificates"; enable = lib.mkEnableOption "ACME certificates";
credentialsFile = mkOption { credentialsFile = lib.mkOption {
type = types.str; type = lib.types.str;
example = "/var/lib/acme/creds.env"; example = "/var/lib/acme/creds.env";
description = '' description = ''
INWX API key file as an 'EnvironmentFile' (see `systemd.exec(5)`) INWX API key file as an 'EnvironmentFile' (see `systemd.exec(5)`)

View file

@ -10,8 +10,8 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.alertmanager = with lib; { options.my.services.alertmanager = {
enable = mkEnableOption "Prometheus alertmanager for monitoring"; enable = lib.mkEnableOption "Prometheus alertmanager for monitoring";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -10,11 +10,11 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.aria2 = with lib; { options.my.services.aria2 = {
enable = mkEnableOption "Aria2 for downloads"; enable = lib.mkEnableOption "Aria2 for downloads";
downloadDir = mkOption { downloadDir = lib.mkOption {
type = types.path; type = lib.types.path;
description = '' description = ''
Directory to store downloaded files. Directory to store downloaded files.
''; '';

View file

@ -8,59 +8,59 @@ let
cfg = config.my.services.backup; cfg = config.my.services.backup;
in in
{ {
options.my.services.backup = with lib; { options.my.services.backup = {
enable = mkEnableOption "Borgbackup Service"; enable = lib.mkEnableOption "Borgbackup Service";
passwordFile = mkOption { passwordFile = lib.mkOption {
type = types.path; type = lib.types.path;
description = "Password for the backup"; description = "Password for the backup";
example = "/run/secrets/password"; example = "/run/secrets/password";
}; };
sshHost = mkOption { sshHost = lib.mkOption {
type = types.str; type = lib.types.str;
description = "ssh-hostname for remote access"; description = "ssh-hostname for remote access";
default = "u181505-sub1.your-storagebox.de"; default = "u181505-sub1.your-storagebox.de";
example = "test.domain.com"; example = "test.domain.com";
}; };
sshUser = mkOption { sshUser = lib.mkOption {
type = types.str; type = lib.types.str;
description = "ssh-user for remote access"; description = "ssh-user for remote access";
default = "u181505-sub1"; default = "u181505-sub1";
example = "max"; example = "max";
}; };
sshPort = mkOption { sshPort = lib.mkOption {
type = types.port; type = lib.types.port;
description = "ssh-port for remote access"; description = "ssh-port for remote access";
default = 23; default = 23;
example = 22; example = 22;
}; };
sshKeyFile = mkOption { sshKeyFile = lib.mkOption {
type = types.path; type = lib.types.path;
description = "ssh-key for remote access"; description = "ssh-key for remote access";
example = "/run/secrets/ssh_key"; example = "/run/secrets/ssh_key";
}; };
OnFailureNotification = mkOption { OnFailureNotification = lib.mkOption {
type = types.bool; type = lib.types.bool;
description = "whether to show a warning to all users or not"; description = "whether to show a warning to all users or not";
default = false; default = false;
}; };
OnFailureMail = mkOption { OnFailureMail = lib.mkOption {
type = types.nullOr types.str; type = lib.types.nullOr lib.types.str;
description = "Mail address where to send the error report"; description = "Mail address where to send the error report";
default = null; default = null;
example = "alarm@mail.com"; example = "alarm@mail.com";
}; };
paths = mkOption { paths = lib.mkOption {
type = with types; listOf str; type = lib.types.listOf lib.types.str;
description = "additional path(s) to back up"; description = "additional path(s) to back up";
default = [ "/" ]; default = [ "/" ];
example = [ "/home/user" ]; example = [ "/home/user" ];
}; };
exclude = mkOption { exclude = lib.mkOption {
type = with types; listOf str; type = lib.types.listOf lib.types.str;
description = "Exclude paths matching any of the given patterns. See `borg help patterns`"; description = "Exclude paths matching any of the given patterns. See `borg help patterns`";
default = [ ]; default = [ ];
example = [ example = [
@ -69,8 +69,8 @@ in
]; ];
}; };
doInit = mkOption { doInit = lib.mkOption {
type = types.bool; type = lib.types.bool;
description = '' description = ''
Run {command}`borg init` if the Run {command}`borg init` if the
specified {option}`repo` does not exist. specified {option}`repo` does not exist.

View file

@ -6,8 +6,8 @@ let
port = config.services.bazarr.listenPort; port = config.services.bazarr.listenPort;
in in
{ {
options.my.services.bazarr = with lib; { options.my.services.bazarr = {
enable = mkEnableOption "Bazarr for subtitle management"; enable = lib.mkEnableOption "Bazarr for subtitle management";
apiKeyFile = lib.mkOption { apiKeyFile = lib.mkOption {
type = lib.types.path; type = lib.types.path;

View file

@ -24,13 +24,13 @@ let
}; };
in in
{ {
options.my.services.blackbox = with lib; { options.my.services.blackbox = {
enable = mkEnableOption "Blackbox prometheus exporter"; enable = lib.mkEnableOption "Blackbox prometheus exporter";
http_endpoints = mkOption { http_endpoints = lib.mkOption {
type = types.listOf types.str; type = lib.types.listOf lib.types.str;
default = [ ]; default = [ ];
example = literalExpression '' example = lib.literalExpression ''
[ [
"https://domain.com" "https://domain.com"
"https://another-domain.com" "https://another-domain.com"

View file

@ -9,20 +9,20 @@ let
cfg = config.my.services.blocky; cfg = config.my.services.blocky;
in in
{ {
options.my.services.blocky = with lib; { options.my.services.blocky = {
enable = mkEnableOption "Blocky DNS Server"; enable = lib.mkEnableOption "Blocky DNS Server";
httpPort = mkOption { httpPort = lib.mkOption {
type = types.port; type = lib.types.port;
default = 8053; default = 8053;
example = 8080; example = 8080;
description = "port for requests"; description = "port for requests";
}; };
settings = mkOption { settings = lib.mkOption {
inherit (pkgs.formats.json { }) type; inherit (pkgs.formats.json { }) type;
default = { }; default = { };
example = literalExpression '' example = lib.literalExpression ''
{ ports.http = "8053" }; { ports.http = "8053" };
''; '';
description = '' description = ''

View file

@ -5,17 +5,17 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.dyndns = with lib; { options.my.services.dyndns = {
enable = mkEnableOption "Dyndns"; enable = lib.mkEnableOption "Dyndns";
username = mkOption { username = lib.mkOption {
type = types.str; type = lib.types.str;
description = "Username for the dyndns."; description = "Username for the dyndns.";
example = "admin"; example = "admin";
default = "Stunkymonkey-dyndns"; default = "Stunkymonkey-dyndns";
}; };
passwordFile = mkOption { passwordFile = lib.mkOption {
type = types.path; type = lib.types.path;
description = "Password for the username for dyndns."; description = "Password for the username for dyndns.";
example = "/run/secrets/freshrss"; example = "/run/secrets/freshrss";
}; };

View file

@ -9,11 +9,11 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.finance = with lib; { options.my.services.finance = {
enable = lib.mkEnableOption "Finance firefly service."; enable = lib.mkEnableOption "Finance firefly service.";
appKeyFile = mkOption { appKeyFile = lib.mkOption {
type = types.path; type = lib.types.path;
description = "appkey for the service."; description = "appkey for the service.";
example = "/run/secrets/freshrss"; example = "/run/secrets/freshrss";
default = "base64:ICs6jizTJnu4U8Sl/+GKIUC6TSK+0i+Lu84CicRhTNE="; default = "base64:ICs6jizTJnu4U8Sl/+GKIUC6TSK+0i+Lu84CicRhTNE=";

View file

@ -10,30 +10,30 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.freshrss = with lib; { options.my.services.freshrss = {
enable = lib.mkEnableOption "FreshRSS feed reader"; enable = lib.mkEnableOption "FreshRSS feed reader";
package = mkOption { package = lib.mkOption {
type = types.package; type = lib.types.package;
default = pkgs.freshrss; default = pkgs.freshrss;
description = "Which FreshRSS package to use."; description = "Which FreshRSS package to use.";
}; };
defaultUser = mkOption { defaultUser = lib.mkOption {
type = types.str; type = lib.types.str;
default = "admin"; default = "admin";
description = "Default username for FreshRSS."; description = "Default username for FreshRSS.";
example = "eva"; example = "eva";
}; };
passwordFile = mkOption { passwordFile = lib.mkOption {
type = types.path; type = lib.types.path;
description = "Password for the defaultUser for FreshRSS."; description = "Password for the defaultUser for FreshRSS.";
example = "/run/secrets/freshrss"; example = "/run/secrets/freshrss";
}; };
language = mkOption { language = lib.mkOption {
type = types.str; type = lib.types.str;
default = "en"; default = "en";
description = "Default language for FreshRSS."; description = "Default language for FreshRSS.";
example = "de"; example = "de";

View file

@ -8,18 +8,18 @@ let
cfg = config.my.services.fritzbox; cfg = config.my.services.fritzbox;
in in
{ {
options.my.services.fritzbox = with lib; { options.my.services.fritzbox = {
enable = mkEnableOption "Fritzbox-Monitoring"; enable = lib.mkEnableOption "Fritzbox-Monitoring";
username = mkOption { username = lib.mkOption {
type = types.str; type = lib.types.str;
default = "prometheus"; default = "prometheus";
example = "admin"; example = "admin";
description = "Admin username"; description = "Admin username";
}; };
passwordFile = mkOption { passwordFile = lib.mkOption {
type = types.str; type = lib.types.str;
example = "/var/lib/fritz/password.txt"; example = "/var/lib/fritz/password.txt";
description = "password stored in a file"; description = "password stored in a file";
}; };

View file

@ -10,18 +10,18 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.grafana = with lib; { options.my.services.grafana = {
enable = mkEnableOption "Grafana for visualizing"; enable = lib.mkEnableOption "Grafana for visualizing";
username = mkOption { username = lib.mkOption {
type = types.str; type = lib.types.str;
default = "felix"; default = "felix";
example = "admin"; example = "admin";
description = "Admin username"; description = "Admin username";
}; };
passwordFile = mkOption { passwordFile = lib.mkOption {
type = types.str; type = lib.types.str;
example = "/var/lib/grafana/password.txt"; example = "/var/lib/grafana/password.txt";
description = "Admin password stored in a file"; description = "Admin password stored in a file";
}; };

View file

@ -10,10 +10,10 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.hedgedoc = with lib; { options.my.services.hedgedoc = {
enable = mkEnableOption "Hedgedoc Music Server"; enable = lib.mkEnableOption "Hedgedoc Music Server";
settings = mkOption { settings = lib.mkOption {
inherit (pkgs.formats.json { }) type; inherit (pkgs.formats.json { }) type;
default = { }; default = { };
example = { example = {

View file

@ -10,14 +10,14 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.home-automation = with lib; { options.my.services.home-automation = {
enable = mkEnableOption "home-assistant server"; enable = lib.mkEnableOption "home-assistant server";
package = lib.mkPackageOption pkgs "home-assistant" { }; package = lib.mkPackageOption pkgs "home-assistant" { };
extraComponents = mkOption { extraComponents = lib.mkOption {
type = types.listOf (types.enum cfg.package.availableComponents); type = lib.types.listOf (lib.types.enum cfg.package.availableComponents);
example = literalExpression '' example = lib.literalExpression ''
[ [
"analytics" "analytics"
"default_config" "default_config"
@ -41,8 +41,8 @@ in
''; '';
}; };
latitude = mkOption { latitude = lib.mkOption {
type = types.nullOr (types.either types.float types.str); type = lib.types.nullOr (lib.types.either lib.types.float lib.types.str);
default = null; default = null;
example = 52.3; example = 52.3;
description = '' description = ''
@ -50,8 +50,8 @@ in
''; '';
}; };
longitude = mkOption { longitude = lib.mkOption {
type = types.nullOr (types.either types.float types.str); type = lib.types.nullOr (lib.types.either lib.types.float lib.types.str);
default = null; default = null;
example = 4.9; example = 4.9;
description = '' description = ''
@ -59,16 +59,16 @@ in
''; '';
}; };
elevation = mkOption { elevation = lib.mkOption {
type = types.nullOr (types.either types.float types.str); type = lib.types.nullOr (lib.types.either lib.types.float lib.types.str);
default = null; default = null;
description = '' description = ''
your location elevation. Impacts sunrise data. your location elevation. Impacts sunrise data.
''; '';
}; };
timezone = mkOption { timezone = lib.mkOption {
type = types.str; type = lib.types.str;
default = "GMT"; default = "GMT";
description = '' description = ''
your timezone. your timezone.

View file

@ -10,8 +10,8 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.homepage = with lib; { options.my.services.homepage = {
enable = mkEnableOption "Stunkymonkey-Hompage"; enable = lib.mkEnableOption "Stunkymonkey-Hompage";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -19,8 +19,8 @@ in
{ {
imports = [ ./config.nix ]; imports = [ ./config.nix ];
options.my.services.homer = with lib; { options.my.services.homer = {
enable = mkEnableOption "Homer Dashboard"; enable = lib.mkEnableOption "Homer Dashboard";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -4,8 +4,8 @@ let
cfg = config.my.services.initrd-ssh; cfg = config.my.services.initrd-ssh;
in in
{ {
options.my.services.initrd-ssh = with lib; { options.my.services.initrd-ssh = {
enable = mkEnableOption "Enable initrd-ssh service"; enable = lib.mkEnableOption "Enable initrd-ssh service";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -19,8 +19,8 @@ let
}); });
in in
{ {
options.my.services.jellyfin = with lib; { options.my.services.jellyfin = {
enable = mkEnableOption "Jellyfin Media Server"; enable = lib.mkEnableOption "Jellyfin Media Server";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -5,8 +5,8 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.jellyseerr = with lib; { options.my.services.jellyseerr = {
enable = mkEnableOption "Sonarr for films management"; enable = lib.mkEnableOption "Sonarr for films management";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -11,35 +11,35 @@ let
port = 3101; port = 3101;
in in
{ {
options.my.services.loki = with lib; { options.my.services.loki = {
enable = mkEnableOption "loki log monitoring"; enable = lib.mkEnableOption "loki log monitoring";
rules = mkOption { rules = lib.mkOption {
type = types.attrsOf ( type = lib.types.attrsOf (
types.submodule { lib.types.submodule {
options = { options = {
condition = mkOption { condition = lib.mkOption {
type = types.str; type = lib.types.str;
description = '' description = ''
Loki alert expression. Loki alert expression.
''; '';
example = ''count_over_time({job=~"secure"} |="sshd[" |~": Failed|: Invalid|: Connection closed by authenticating user" | __error__="" [15m]) > 15''; example = ''count_over_time({job=~"secure"} |="sshd[" |~": Failed|: Invalid|: Connection closed by authenticating user" | __error__="" [15m]) > 15'';
default = null; default = null;
}; };
description = mkOption { description = lib.mkOption {
type = types.str; type = lib.types.str;
description = '' description = ''
Loki alert message. Loki alert message.
''; '';
example = "Prometheus encountered value {{ $value }} with {{ $labels }}"; example = "Prometheus encountered value {{ $value }} with {{ $labels }}";
default = null; default = null;
}; };
labels = mkOption { labels = lib.mkOption {
type = types.nullOr (types.attrsOf types.str); type = lib.types.nullOr (lib.types.attrsOf lib.types.str);
description = '' description = ''
Additional alert labels. Additional alert labels.
''; '';
example = literalExpression '' example = lib.literalExpression ''
{ severity = "page" }; { severity = "page" };
''; '';
default = { }; default = { };

View file

@ -8,24 +8,24 @@ let
cfg = config.my.services.matrix-bot; cfg = config.my.services.matrix-bot;
in in
{ {
options.my.services.matrix-bot = with lib; { options.my.services.matrix-bot = {
enable = mkEnableOption "enable matrix forwarding bot"; enable = lib.mkEnableOption "enable matrix forwarding bot";
Username = mkOption { Username = lib.mkOption {
type = types.str; type = lib.types.str;
description = "Matrix bot name."; description = "Matrix bot name.";
example = "@bot:matrix.org"; example = "@bot:matrix.org";
default = "@stunkymonkey-bot:matrix.org"; default = "@stunkymonkey-bot:matrix.org";
}; };
PasswortFile = mkOption { PasswortFile = lib.mkOption {
type = types.path; type = lib.types.path;
description = '' description = ''
Password for the bot. Password for the bot.
format: MX_TOKEN=<token> format: MX_TOKEN=<token>
''; '';
example = "/run/secrets/password"; example = "/run/secrets/password";
}; };
RoomID = mkOption { RoomID = lib.mkOption {
type = types.str; type = lib.types.str;
description = "Matrix room id."; description = "Matrix room id.";
example = "!abcdefghijklmnopqr:matrix.org"; example = "!abcdefghijklmnopqr:matrix.org";
default = "!ZWnKiKLuQNBkBGMPCl:matrix.org"; default = "!ZWnKiKLuQNBkBGMPCl:matrix.org";

View file

@ -9,8 +9,8 @@ let
cfg = config.my.services.minecraft-server; cfg = config.my.services.minecraft-server;
in in
{ {
options.my.services.minecraft-server = with lib; { options.my.services.minecraft-server = {
enable = mkEnableOption "Minecraft Server"; enable = lib.mkEnableOption "Minecraft Server";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -10,10 +10,10 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.navidrome = with lib; { options.my.services.navidrome = {
enable = mkEnableOption "Navidrome Music Server"; enable = lib.mkEnableOption "Navidrome Music Server";
settings = mkOption { settings = lib.mkOption {
inherit (pkgs.formats.json { }) type; inherit (pkgs.formats.json { }) type;
default = { default = {
EnableSharing = true; EnableSharing = true;
@ -29,8 +29,8 @@ in
''; '';
}; };
musicFolder = mkOption { musicFolder = lib.mkOption {
type = types.str; type = lib.types.str;
example = "/mnt/music/"; example = "/mnt/music/";
description = "Music folder"; description = "Music folder";
}; };

View file

@ -10,28 +10,28 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.nextcloud = with lib; { options.my.services.nextcloud = {
enable = mkEnableOption "Nextcloud"; enable = lib.mkEnableOption "Nextcloud";
maxSize = mkOption { maxSize = lib.mkOption {
type = types.str; type = lib.types.str;
default = "10G"; default = "10G";
example = "512M"; example = "512M";
description = "Maximum file upload size"; description = "Maximum file upload size";
}; };
admin = mkOption { admin = lib.mkOption {
type = types.str; type = lib.types.str;
default = "felix"; default = "felix";
example = "admin"; example = "admin";
description = "Name of the admin user"; description = "Name of the admin user";
}; };
default_phone_region = mkOption { default_phone_region = lib.mkOption {
type = types.str; type = lib.types.str;
default = "DE"; default = "DE";
example = "US"; example = "US";
description = "country codes for automatic phone-number "; description = "country codes for automatic phone-number ";
}; };
passwordFile = mkOption { passwordFile = lib.mkOption {
type = types.path; type = lib.types.path;
example = "/var/lib/nextcloud/password.txt"; example = "/var/lib/nextcloud/password.txt";
description = '' description = ''
Path to a file containing the admin's password, must be readable by Path to a file containing the admin's password, must be readable by
@ -39,8 +39,8 @@ in
''; '';
}; };
exporterPasswordFile = mkOption { exporterPasswordFile = lib.mkOption {
type = types.path; type = lib.types.path;
example = "/var/lib/nextcloud/password.txt"; example = "/var/lib/nextcloud/password.txt";
description = '' description = ''
Path to a file containing the admin's password, must be readable by Path to a file containing the admin's password, must be readable by

View file

@ -10,8 +10,8 @@ let
cfg = config.my.services.node-exporter; cfg = config.my.services.node-exporter;
in in
{ {
options.my.services.node-exporter = with lib; { options.my.services.node-exporter = {
enable = mkEnableOption "Node-Exporter for monitoring"; enable = lib.mkEnableOption "Node-Exporter for monitoring";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -5,23 +5,23 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.paperless = with lib; { options.my.services.paperless = {
enable = mkEnableOption "Paperless Server"; enable = lib.mkEnableOption "Paperless Server";
passwordFile = mkOption { passwordFile = lib.mkOption {
type = types.path; type = lib.types.path;
description = "Password for the defaultUser for FreshRSS."; description = "Password for the defaultUser for FreshRSS.";
example = "/run/secrets/freshrss"; example = "/run/secrets/freshrss";
}; };
mediaDir = mkOption { mediaDir = lib.mkOption {
type = types.path; type = lib.types.path;
description = "Location of the FreshRSS data."; description = "Location of the FreshRSS data.";
example = "/data/docs"; example = "/data/docs";
}; };
settings = mkOption { settings = lib.mkOption {
type = types.attrs; type = lib.types.attrs;
default = { }; default = { };
description = "additional extraConfig"; description = "additional extraConfig";
}; };

View file

@ -5,10 +5,10 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.passworts = with lib; { options.my.services.passworts = {
enable = mkEnableOption "Passwords Server"; enable = lib.mkEnableOption "Passwords Server";
port = mkOption { port = lib.mkOption {
type = types.port; type = lib.types.port;
default = 5010; default = 5010;
example = 8080; example = 8080;
description = "Internal port for webui"; description = "Internal port for webui";

View file

@ -10,50 +10,50 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.prometheus = with lib; { options.my.services.prometheus = {
enable = mkEnableOption "Prometheus for monitoring"; enable = lib.mkEnableOption "Prometheus for monitoring";
scrapeInterval = mkOption { scrapeInterval = lib.mkOption {
type = types.str; type = lib.types.str;
default = "15s"; default = "15s";
example = "1m"; example = "1m";
description = "Scrape interval"; description = "Scrape interval";
}; };
retentionTime = mkOption { retentionTime = lib.mkOption {
type = types.str; type = lib.types.str;
default = "2y"; default = "2y";
example = "1m"; example = "1m";
description = "retention time"; description = "retention time";
}; };
# a good collections for alerts can be found here: https://samber.github.io/awesome-prometheus-alerts/rules#blackbox # a good collections for alerts can be found here: https://samber.github.io/awesome-prometheus-alerts/rules#blackbox
rules = mkOption { rules = lib.mkOption {
type = types.attrsOf ( type = lib.types.attrsOf (
types.submodule { lib.types.submodule {
options = { options = {
condition = mkOption { condition = lib.mkOption {
type = types.str; type = lib.types.str;
description = '' description = ''
Prometheus alert expression. Prometheus alert expression.
''; '';
example = ''disk_used_percent{mode!="ro"} >= 90''; example = "up == 0";
default = null; default = null;
}; };
description = mkOption { description = lib.mkOption {
type = types.str; type = lib.types.str;
description = '' description = ''
Prometheus alert message. Prometheus alert message.
''; '';
example = "Prometheus encountered value {{ $value }} with {{ $labels }}"; example = "Prometheus encountered value {{ $value }} with {{ $labels }}";
default = null; default = null;
}; };
labels = mkOption { labels = lib.mkOption {
type = types.nullOr (types.attrsOf types.str); type = lib.types.nullOr (lib.types.attrsOf lib.types.str);
description = '' description = ''
Additional alert labels. Additional alert labels.
''; '';
example = literalExpression '' example = lib.literalExpression ''
{ severity = "page" }; { severity = "page" };
''; '';
default = { }; default = { };

View file

@ -5,11 +5,11 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.promtail = with lib; { options.my.services.promtail = {
enable = mkEnableOption "promtail log forwarding"; enable = lib.mkEnableOption "promtail log forwarding";
port = mkOption { port = lib.mkOption {
type = types.port; type = lib.types.port;
default = 9081; default = 9081;
example = 3002; example = 3002;
description = "Internal port"; description = "Internal port";

View file

@ -7,8 +7,8 @@ let
port = 9696; port = 9696;
in in
{ {
options.my.services.prowlarr = with lib; { options.my.services.prowlarr = {
enable = mkEnableOption "Prowlarr for indexing"; enable = lib.mkEnableOption "Prowlarr for indexing";
apiKeyFile = lib.mkOption { apiKeyFile = lib.mkOption {
type = lib.types.path; type = lib.types.path;

View file

@ -7,8 +7,8 @@ let
port = 7878; port = 7878;
in in
{ {
options.my.services.radarr = with lib; { options.my.services.radarr = {
enable = mkEnableOption "Radarr for film management"; enable = lib.mkEnableOption "Radarr for film management";
apiKeyFile = lib.mkOption { apiKeyFile = lib.mkOption {
type = lib.types.path; type = lib.types.path;

View file

@ -7,8 +7,8 @@ let
port = 8989; port = 8989;
in in
{ {
options.my.services.sonarr = with lib; { options.my.services.sonarr = {
enable = mkEnableOption "Sonarr for series management"; enable = lib.mkEnableOption "Sonarr for series management";
apiKeyFile = lib.mkOption { apiKeyFile = lib.mkOption {
type = lib.types.path; type = lib.types.path;

View file

@ -5,8 +5,8 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.tandoor-recipes = with lib; { options.my.services.tandoor-recipes = {
enable = mkEnableOption "Tandoor Recipes"; enable = lib.mkEnableOption "Tandoor Recipes";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -5,11 +5,11 @@ let
inherit (config.networking) domain; inherit (config.networking) domain;
in in
{ {
options.my.services.vpn = with lib; { options.my.services.vpn = {
enable = mkEnableOption "Headscale VPN"; enable = lib.mkEnableOption "Headscale VPN";
isMaster = mkEnableOption "Headscale Master"; isMaster = lib.mkEnableOption "Headscale Master";
port = mkOption { port = lib.mkOption {
type = types.port; type = lib.types.port;
default = 8090; default = 8090;
example = 8080; example = 8080;
description = "Internal port"; description = "Internal port";

View file

@ -9,8 +9,8 @@ let
cfg = config.my.system.avahi; cfg = config.my.system.avahi;
in in
{ {
options.my.system.avahi = with lib; { options.my.system.avahi = {
enable = mkEnableOption "avahi configuration"; enable = lib.mkEnableOption "avahi configuration";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -10,8 +10,8 @@ let
cfg = config.my.system.docker; cfg = config.my.system.docker;
in in
{ {
options.my.system.docker = with lib; { options.my.system.docker = {
enable = mkEnableOption "docker configuration"; enable = lib.mkEnableOption "docker configuration";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -8,11 +8,11 @@ let
cfg = config.my.system.fonts; cfg = config.my.system.fonts;
in in
{ {
options.my.system.fonts = with lib; { options.my.system.fonts = {
enable = mkEnableOption "fonts configuration"; enable = lib.mkEnableOption "fonts configuration";
additionalFonts = mkOption { additionalFonts = lib.mkOption {
type = types.listOf types.package; type = lib.types.listOf lib.types.package;
default = [ ]; default = [ ];
example = "fira"; example = "fira";
description = "Which additional fonts should be added as well"; description = "Which additional fonts should be added as well";

View file

@ -3,16 +3,16 @@ let
cfg = config.my.system.kvm; cfg = config.my.system.kvm;
in in
{ {
options.my.system.kvm = with lib; { options.my.system.kvm = {
enable = mkEnableOption "kvm configuration"; enable = lib.mkEnableOption "kvm configuration";
cpuFlavor = mkOption { cpuFlavor = lib.mkOption {
type = type = lib.types.nullOr (
with types; lib.types.enum [
nullOr (enum [
"intel" "intel"
"amd" "amd"
]); ]
);
default = null; default = null;
example = "intel"; example = "intel";
description = "Which kind of CPU to activate kernelModules"; description = "Which kind of CPU to activate kernelModules";

View file

@ -10,8 +10,8 @@ let
cfg = config.my.system.miracast; cfg = config.my.system.miracast;
in in
{ {
options.my.system.miracast = with lib; { options.my.system.miracast = {
enable = mkEnableOption "miracast configuration"; enable = lib.mkEnableOption "miracast configuration";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -10,8 +10,8 @@ let
cfg = config.my.system.podman; cfg = config.my.system.podman;
in in
{ {
options.my.system.podman = with lib; { options.my.system.podman = {
enable = mkEnableOption "podman configuration"; enable = lib.mkEnableOption "podman configuration";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -10,8 +10,8 @@ let
cfg = config.my.system.spell-check; cfg = config.my.system.spell-check;
in in
{ {
options.my.system.spell-check = with lib; { options.my.system.spell-check = {
enable = mkEnableOption "spell-check configuration"; enable = lib.mkEnableOption "spell-check configuration";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -8,8 +8,8 @@ let
cfg = config.my.profiles."3d-design"; cfg = config.my.profiles."3d-design";
in in
{ {
options.my.profiles."3d-design" = with lib; { options.my.profiles."3d-design" = {
enable = mkEnableOption "3d-design profile"; enable = lib.mkEnableOption "3d-design profile";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -8,8 +8,8 @@ let
cfg = config.my.profiles.android; cfg = config.my.profiles.android;
in in
{ {
options.my.profiles.android = with lib; { options.my.profiles.android = {
enable = mkEnableOption "android profile"; enable = lib.mkEnableOption "android profile";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -8,8 +8,8 @@ let
cfg = config.my.profiles.clean; cfg = config.my.profiles.clean;
in in
{ {
options.my.profiles.clean = with lib; { options.my.profiles.clean = {
enable = mkEnableOption "clean profile"; enable = lib.mkEnableOption "clean profile";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -8,8 +8,8 @@ let
cfg = config.my.profiles.desktop-apps; cfg = config.my.profiles.desktop-apps;
in in
{ {
options.my.profiles.desktop-apps = with lib; { options.my.profiles.desktop-apps = {
enable = mkEnableOption "desktop-apps profile"; enable = lib.mkEnableOption "desktop-apps profile";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -8,8 +8,8 @@ let
cfg = config.my.profiles.desktop-dev; cfg = config.my.profiles.desktop-dev;
in in
{ {
options.my.profiles.desktop-dev = with lib; { options.my.profiles.desktop-dev = {
enable = mkEnableOption "desktop-dev profile"; enable = lib.mkEnableOption "desktop-dev profile";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -8,8 +8,8 @@ let
cfg = config.my.profiles.development; cfg = config.my.profiles.development;
in in
{ {
options.my.profiles.development = with lib; { options.my.profiles.development = {
enable = mkEnableOption "development profile"; enable = lib.mkEnableOption "development profile";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {