diff --git a/modules/hardware/bluetooth/default.nix b/modules/hardware/bluetooth/default.nix index 446eb65..e46963b 100644 --- a/modules/hardware/bluetooth/default.nix +++ b/modules/hardware/bluetooth/default.nix @@ -8,8 +8,8 @@ let cfg = config.my.hardware.bluetooth; in { - options.my.hardware.bluetooth = with lib; { - enable = mkEnableOption "bluetooth configuration"; + options.my.hardware.bluetooth = { + enable = lib.mkEnableOption "bluetooth configuration"; }; config = lib.mkIf cfg.enable { diff --git a/modules/hardware/debug/default.nix b/modules/hardware/debug/default.nix index 0d6168a..2891e94 100644 --- a/modules/hardware/debug/default.nix +++ b/modules/hardware/debug/default.nix @@ -8,8 +8,8 @@ let cfg = config.my.hardware.debug; in { - options.my.hardware.debug = with lib; { - enable = mkEnableOption "hardware-debug configuration"; + options.my.hardware.debug = { + enable = lib.mkEnableOption "hardware-debug configuration"; }; config = lib.mkIf cfg.enable { diff --git a/modules/hardware/drive-monitor/default.nix b/modules/hardware/drive-monitor/default.nix index 895c7c5..86f6a87 100644 --- a/modules/hardware/drive-monitor/default.nix +++ b/modules/hardware/drive-monitor/default.nix @@ -3,11 +3,11 @@ let cfg = config.my.hardware.drive-monitor; in { - options.my.hardware.drive-monitor = with lib; { - enable = mkEnableOption "drive-monitor configuration"; + options.my.hardware.drive-monitor = { + enable = lib.mkEnableOption "drive-monitor configuration"; - OnFailureMail = mkOption { - type = types.nullOr types.str; + OnFailureMail = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Mail address where to send the error report"; default = null; example = "alarm@mail.com"; diff --git a/modules/hardware/firmware/default.nix b/modules/hardware/firmware/default.nix index c1f783d..a7e4fd2 100644 --- a/modules/hardware/firmware/default.nix +++ b/modules/hardware/firmware/default.nix @@ -3,16 +3,16 @@ let cfg = config.my.hardware.firmware; in { - options.my.hardware.firmware = with lib; { - enable = mkEnableOption "firmware configuration"; + options.my.hardware.firmware = { + enable = lib.mkEnableOption "firmware configuration"; - cpuFlavor = mkOption { - type = - with types; - nullOr (enum [ + cpuFlavor = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ "intel" "amd" - ]); + ] + ); default = null; example = "intel"; description = "Which kind of CPU to activate micro-code updates"; diff --git a/modules/hardware/graphics/default.nix b/modules/hardware/graphics/default.nix index 400df22..ba01f81 100644 --- a/modules/hardware/graphics/default.nix +++ b/modules/hardware/graphics/default.nix @@ -8,15 +8,15 @@ let cfg = config.my.hardware.graphics; in { - options.my.hardware.graphics = with lib; { - enable = mkEnableOption "graphics configuration"; - cpuFlavor = mkOption { - type = - with types; - nullOr (enum [ + options.my.hardware.graphics = { + enable = lib.mkEnableOption "graphics configuration"; + cpuFlavor = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ "amd" "intel" - ]); + ] + ); default = null; example = "intel"; description = "Which kind of GPU"; diff --git a/modules/hardware/id-card/default.nix b/modules/hardware/id-card/default.nix index 1e7ed5b..09758b3 100644 --- a/modules/hardware/id-card/default.nix +++ b/modules/hardware/id-card/default.nix @@ -3,8 +3,8 @@ let cfg = config.my.hardware.id-card; in { - options.my.hardware.id-card = with lib; { - enable = mkEnableOption "german id card authentication"; + options.my.hardware.id-card = { + enable = lib.mkEnableOption "german id card authentication"; }; config = lib.mkIf cfg.enable { diff --git a/modules/services/acme/default.nix b/modules/services/acme/default.nix index 13bcfd6..e281ec7 100644 --- a/modules/services/acme/default.nix +++ b/modules/services/acme/default.nix @@ -5,11 +5,11 @@ let inherit (config.networking) domain; in { - options.my.services.acme = with lib; { - enable = mkEnableOption "ACME certificates"; + options.my.services.acme = { + enable = lib.mkEnableOption "ACME certificates"; - credentialsFile = mkOption { - type = types.str; + credentialsFile = lib.mkOption { + type = lib.types.str; example = "/var/lib/acme/creds.env"; description = '' INWX API key file as an 'EnvironmentFile' (see `systemd.exec(5)`) diff --git a/modules/services/alertmanager/default.nix b/modules/services/alertmanager/default.nix index 8139e41..af40baf 100644 --- a/modules/services/alertmanager/default.nix +++ b/modules/services/alertmanager/default.nix @@ -10,8 +10,8 @@ let inherit (config.networking) domain; in { - options.my.services.alertmanager = with lib; { - enable = mkEnableOption "Prometheus alertmanager for monitoring"; + options.my.services.alertmanager = { + enable = lib.mkEnableOption "Prometheus alertmanager for monitoring"; }; config = lib.mkIf cfg.enable { diff --git a/modules/services/aria2/default.nix b/modules/services/aria2/default.nix index 687c6d5..6c33651 100644 --- a/modules/services/aria2/default.nix +++ b/modules/services/aria2/default.nix @@ -10,11 +10,11 @@ let inherit (config.networking) domain; in { - options.my.services.aria2 = with lib; { - enable = mkEnableOption "Aria2 for downloads"; + options.my.services.aria2 = { + enable = lib.mkEnableOption "Aria2 for downloads"; - downloadDir = mkOption { - type = types.path; + downloadDir = lib.mkOption { + type = lib.types.path; description = '' Directory to store downloaded files. ''; diff --git a/modules/services/backup/default.nix b/modules/services/backup/default.nix index f13612f..3918827 100644 --- a/modules/services/backup/default.nix +++ b/modules/services/backup/default.nix @@ -8,59 +8,59 @@ let cfg = config.my.services.backup; in { - options.my.services.backup = with lib; { - enable = mkEnableOption "Borgbackup Service"; + options.my.services.backup = { + enable = lib.mkEnableOption "Borgbackup Service"; - passwordFile = mkOption { - type = types.path; + passwordFile = lib.mkOption { + type = lib.types.path; description = "Password for the backup"; example = "/run/secrets/password"; }; - sshHost = mkOption { - type = types.str; + sshHost = lib.mkOption { + type = lib.types.str; description = "ssh-hostname for remote access"; default = "u181505-sub1.your-storagebox.de"; example = "test.domain.com"; }; - sshUser = mkOption { - type = types.str; + sshUser = lib.mkOption { + type = lib.types.str; description = "ssh-user for remote access"; default = "u181505-sub1"; example = "max"; }; - sshPort = mkOption { - type = types.port; + sshPort = lib.mkOption { + type = lib.types.port; description = "ssh-port for remote access"; default = 23; example = 22; }; - sshKeyFile = mkOption { - type = types.path; + sshKeyFile = lib.mkOption { + type = lib.types.path; description = "ssh-key for remote access"; example = "/run/secrets/ssh_key"; }; - OnFailureNotification = mkOption { - type = types.bool; + OnFailureNotification = lib.mkOption { + type = lib.types.bool; description = "whether to show a warning to all users or not"; default = false; }; - OnFailureMail = mkOption { - type = types.nullOr types.str; + OnFailureMail = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Mail address where to send the error report"; default = null; example = "alarm@mail.com"; }; - paths = mkOption { - type = with types; listOf str; + paths = lib.mkOption { + type = lib.types.listOf lib.types.str; description = "additional path(s) to back up"; default = [ "/" ]; example = [ "/home/user" ]; }; - exclude = mkOption { - type = with types; listOf str; + exclude = lib.mkOption { + type = lib.types.listOf lib.types.str; description = "Exclude paths matching any of the given patterns. See `borg help patterns`"; default = [ ]; example = [ @@ -69,8 +69,8 @@ in ]; }; - doInit = mkOption { - type = types.bool; + doInit = lib.mkOption { + type = lib.types.bool; description = '' Run {command}`borg init` if the specified {option}`repo` does not exist. diff --git a/modules/services/bazarr/default.nix b/modules/services/bazarr/default.nix index 5b86235..866b1b0 100644 --- a/modules/services/bazarr/default.nix +++ b/modules/services/bazarr/default.nix @@ -6,8 +6,8 @@ let port = config.services.bazarr.listenPort; in { - options.my.services.bazarr = with lib; { - enable = mkEnableOption "Bazarr for subtitle management"; + options.my.services.bazarr = { + enable = lib.mkEnableOption "Bazarr for subtitle management"; apiKeyFile = lib.mkOption { type = lib.types.path; diff --git a/modules/services/blackbox/default.nix b/modules/services/blackbox/default.nix index e06d3f2..1ee7c26 100644 --- a/modules/services/blackbox/default.nix +++ b/modules/services/blackbox/default.nix @@ -24,13 +24,13 @@ let }; in { - options.my.services.blackbox = with lib; { - enable = mkEnableOption "Blackbox prometheus exporter"; + options.my.services.blackbox = { + enable = lib.mkEnableOption "Blackbox prometheus exporter"; - http_endpoints = mkOption { - type = types.listOf types.str; + http_endpoints = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; - example = literalExpression '' + example = lib.literalExpression '' [ "https://domain.com" "https://another-domain.com" diff --git a/modules/services/blocky/default.nix b/modules/services/blocky/default.nix index f5e336b..2cc6fb9 100644 --- a/modules/services/blocky/default.nix +++ b/modules/services/blocky/default.nix @@ -9,20 +9,20 @@ let cfg = config.my.services.blocky; in { - options.my.services.blocky = with lib; { - enable = mkEnableOption "Blocky DNS Server"; + options.my.services.blocky = { + enable = lib.mkEnableOption "Blocky DNS Server"; - httpPort = mkOption { - type = types.port; + httpPort = lib.mkOption { + type = lib.types.port; default = 8053; example = 8080; description = "port for requests"; }; - settings = mkOption { + settings = lib.mkOption { inherit (pkgs.formats.json { }) type; default = { }; - example = literalExpression '' + example = lib.literalExpression '' { ports.http = "8053" }; ''; description = '' diff --git a/modules/services/dyndns/default.nix b/modules/services/dyndns/default.nix index 70023b5..91b6bd4 100644 --- a/modules/services/dyndns/default.nix +++ b/modules/services/dyndns/default.nix @@ -5,17 +5,17 @@ let inherit (config.networking) domain; in { - options.my.services.dyndns = with lib; { - enable = mkEnableOption "Dyndns"; + options.my.services.dyndns = { + enable = lib.mkEnableOption "Dyndns"; - username = mkOption { - type = types.str; + username = lib.mkOption { + type = lib.types.str; description = "Username for the dyndns."; example = "admin"; default = "Stunkymonkey-dyndns"; }; - passwordFile = mkOption { - type = types.path; + passwordFile = lib.mkOption { + type = lib.types.path; description = "Password for the username for dyndns."; example = "/run/secrets/freshrss"; }; diff --git a/modules/services/finance/default.nix b/modules/services/finance/default.nix index f7c2efd..385c087 100644 --- a/modules/services/finance/default.nix +++ b/modules/services/finance/default.nix @@ -9,11 +9,11 @@ let inherit (config.networking) domain; in { - options.my.services.finance = with lib; { + options.my.services.finance = { enable = lib.mkEnableOption "Finance firefly service."; - appKeyFile = mkOption { - type = types.path; + appKeyFile = lib.mkOption { + type = lib.types.path; description = "appkey for the service."; example = "/run/secrets/freshrss"; default = "base64:ICs6jizTJnu4U8Sl/+GKIUC6TSK+0i+Lu84CicRhTNE="; diff --git a/modules/services/freshrss/default.nix b/modules/services/freshrss/default.nix index 68e092e..d54abc7 100644 --- a/modules/services/freshrss/default.nix +++ b/modules/services/freshrss/default.nix @@ -10,30 +10,30 @@ let inherit (config.networking) domain; in { - options.my.services.freshrss = with lib; { + options.my.services.freshrss = { enable = lib.mkEnableOption "FreshRSS feed reader"; - package = mkOption { - type = types.package; + package = lib.mkOption { + type = lib.types.package; default = pkgs.freshrss; description = "Which FreshRSS package to use."; }; - defaultUser = mkOption { - type = types.str; + defaultUser = lib.mkOption { + type = lib.types.str; default = "admin"; description = "Default username for FreshRSS."; example = "eva"; }; - passwordFile = mkOption { - type = types.path; + passwordFile = lib.mkOption { + type = lib.types.path; description = "Password for the defaultUser for FreshRSS."; example = "/run/secrets/freshrss"; }; - language = mkOption { - type = types.str; + language = lib.mkOption { + type = lib.types.str; default = "en"; description = "Default language for FreshRSS."; example = "de"; diff --git a/modules/services/fritzbox/default.nix b/modules/services/fritzbox/default.nix index 0f38fd6..042fd4a 100644 --- a/modules/services/fritzbox/default.nix +++ b/modules/services/fritzbox/default.nix @@ -8,18 +8,18 @@ let cfg = config.my.services.fritzbox; in { - options.my.services.fritzbox = with lib; { - enable = mkEnableOption "Fritzbox-Monitoring"; + options.my.services.fritzbox = { + enable = lib.mkEnableOption "Fritzbox-Monitoring"; - username = mkOption { - type = types.str; + username = lib.mkOption { + type = lib.types.str; default = "prometheus"; example = "admin"; description = "Admin username"; }; - passwordFile = mkOption { - type = types.str; + passwordFile = lib.mkOption { + type = lib.types.str; example = "/var/lib/fritz/password.txt"; description = "password stored in a file"; }; diff --git a/modules/services/grafana/default.nix b/modules/services/grafana/default.nix index 2e2829f..3b045b7 100644 --- a/modules/services/grafana/default.nix +++ b/modules/services/grafana/default.nix @@ -10,18 +10,18 @@ let inherit (config.networking) domain; in { - options.my.services.grafana = with lib; { - enable = mkEnableOption "Grafana for visualizing"; + options.my.services.grafana = { + enable = lib.mkEnableOption "Grafana for visualizing"; - username = mkOption { - type = types.str; + username = lib.mkOption { + type = lib.types.str; default = "felix"; example = "admin"; description = "Admin username"; }; - passwordFile = mkOption { - type = types.str; + passwordFile = lib.mkOption { + type = lib.types.str; example = "/var/lib/grafana/password.txt"; description = "Admin password stored in a file"; }; diff --git a/modules/services/hedgedoc/default.nix b/modules/services/hedgedoc/default.nix index 9510604..460efd0 100644 --- a/modules/services/hedgedoc/default.nix +++ b/modules/services/hedgedoc/default.nix @@ -10,10 +10,10 @@ let inherit (config.networking) domain; in { - options.my.services.hedgedoc = with lib; { - enable = mkEnableOption "Hedgedoc Music Server"; + options.my.services.hedgedoc = { + enable = lib.mkEnableOption "Hedgedoc Music Server"; - settings = mkOption { + settings = lib.mkOption { inherit (pkgs.formats.json { }) type; default = { }; example = { diff --git a/modules/services/home-automation/default.nix b/modules/services/home-automation/default.nix index 9164cff..6d10d95 100644 --- a/modules/services/home-automation/default.nix +++ b/modules/services/home-automation/default.nix @@ -10,14 +10,14 @@ let inherit (config.networking) domain; in { - options.my.services.home-automation = with lib; { - enable = mkEnableOption "home-assistant server"; + options.my.services.home-automation = { + enable = lib.mkEnableOption "home-assistant server"; package = lib.mkPackageOption pkgs "home-assistant" { }; - extraComponents = mkOption { - type = types.listOf (types.enum cfg.package.availableComponents); - example = literalExpression '' + extraComponents = lib.mkOption { + type = lib.types.listOf (lib.types.enum cfg.package.availableComponents); + example = lib.literalExpression '' [ "analytics" "default_config" @@ -41,8 +41,8 @@ in ''; }; - latitude = mkOption { - type = types.nullOr (types.either types.float types.str); + latitude = lib.mkOption { + type = lib.types.nullOr (lib.types.either lib.types.float lib.types.str); default = null; example = 52.3; description = '' @@ -50,8 +50,8 @@ in ''; }; - longitude = mkOption { - type = types.nullOr (types.either types.float types.str); + longitude = lib.mkOption { + type = lib.types.nullOr (lib.types.either lib.types.float lib.types.str); default = null; example = 4.9; description = '' @@ -59,16 +59,16 @@ in ''; }; - elevation = mkOption { - type = types.nullOr (types.either types.float types.str); + elevation = lib.mkOption { + type = lib.types.nullOr (lib.types.either lib.types.float lib.types.str); default = null; description = '' your location elevation. Impacts sunrise data. ''; }; - timezone = mkOption { - type = types.str; + timezone = lib.mkOption { + type = lib.types.str; default = "GMT"; description = '' your timezone. diff --git a/modules/services/homepage/default.nix b/modules/services/homepage/default.nix index be075e4..5690748 100644 --- a/modules/services/homepage/default.nix +++ b/modules/services/homepage/default.nix @@ -10,8 +10,8 @@ let inherit (config.networking) domain; in { - options.my.services.homepage = with lib; { - enable = mkEnableOption "Stunkymonkey-Hompage"; + options.my.services.homepage = { + enable = lib.mkEnableOption "Stunkymonkey-Hompage"; }; config = lib.mkIf cfg.enable { diff --git a/modules/services/homer/default.nix b/modules/services/homer/default.nix index c54dec5..cdc122d 100644 --- a/modules/services/homer/default.nix +++ b/modules/services/homer/default.nix @@ -19,8 +19,8 @@ in { imports = [ ./config.nix ]; - options.my.services.homer = with lib; { - enable = mkEnableOption "Homer Dashboard"; + options.my.services.homer = { + enable = lib.mkEnableOption "Homer Dashboard"; }; config = lib.mkIf cfg.enable { diff --git a/modules/services/initrd-ssh/default.nix b/modules/services/initrd-ssh/default.nix index f7d0099..18344ea 100644 --- a/modules/services/initrd-ssh/default.nix +++ b/modules/services/initrd-ssh/default.nix @@ -4,8 +4,8 @@ let cfg = config.my.services.initrd-ssh; in { - options.my.services.initrd-ssh = with lib; { - enable = mkEnableOption "Enable initrd-ssh service"; + options.my.services.initrd-ssh = { + enable = lib.mkEnableOption "Enable initrd-ssh service"; }; config = lib.mkIf cfg.enable { diff --git a/modules/services/jellyfin/default.nix b/modules/services/jellyfin/default.nix index 819122d..a1b317c 100644 --- a/modules/services/jellyfin/default.nix +++ b/modules/services/jellyfin/default.nix @@ -19,8 +19,8 @@ let }); in { - options.my.services.jellyfin = with lib; { - enable = mkEnableOption "Jellyfin Media Server"; + options.my.services.jellyfin = { + enable = lib.mkEnableOption "Jellyfin Media Server"; }; config = lib.mkIf cfg.enable { diff --git a/modules/services/jellyseerr/default.nix b/modules/services/jellyseerr/default.nix index 897f6c2..3a5800a 100644 --- a/modules/services/jellyseerr/default.nix +++ b/modules/services/jellyseerr/default.nix @@ -5,8 +5,8 @@ let inherit (config.networking) domain; in { - options.my.services.jellyseerr = with lib; { - enable = mkEnableOption "Sonarr for films management"; + options.my.services.jellyseerr = { + enable = lib.mkEnableOption "Sonarr for films management"; }; config = lib.mkIf cfg.enable { diff --git a/modules/services/loki/default.nix b/modules/services/loki/default.nix index ed605eb..80abb6f 100644 --- a/modules/services/loki/default.nix +++ b/modules/services/loki/default.nix @@ -11,35 +11,35 @@ let port = 3101; in { - options.my.services.loki = with lib; { - enable = mkEnableOption "loki log monitoring"; + options.my.services.loki = { + enable = lib.mkEnableOption "loki log monitoring"; - rules = mkOption { - type = types.attrsOf ( - types.submodule { + rules = lib.mkOption { + type = lib.types.attrsOf ( + lib.types.submodule { options = { - condition = mkOption { - type = types.str; + condition = lib.mkOption { + type = lib.types.str; description = '' Loki alert expression. ''; example = ''count_over_time({job=~"secure"} |="sshd[" |~": Failed|: Invalid|: Connection closed by authenticating user" | __error__="" [15m]) > 15''; default = null; }; - description = mkOption { - type = types.str; + description = lib.mkOption { + type = lib.types.str; description = '' Loki alert message. ''; example = "Prometheus encountered value {{ $value }} with {{ $labels }}"; default = null; }; - labels = mkOption { - type = types.nullOr (types.attrsOf types.str); + labels = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.str); description = '' Additional alert labels. ''; - example = literalExpression '' + example = lib.literalExpression '' { severity = "page" }; ''; default = { }; diff --git a/modules/services/matrix-bot/default.nix b/modules/services/matrix-bot/default.nix index 5cf9adb..7f1a3aa 100644 --- a/modules/services/matrix-bot/default.nix +++ b/modules/services/matrix-bot/default.nix @@ -8,24 +8,24 @@ let cfg = config.my.services.matrix-bot; in { - options.my.services.matrix-bot = with lib; { - enable = mkEnableOption "enable matrix forwarding bot"; - Username = mkOption { - type = types.str; + options.my.services.matrix-bot = { + enable = lib.mkEnableOption "enable matrix forwarding bot"; + Username = lib.mkOption { + type = lib.types.str; description = "Matrix bot name."; example = "@bot:matrix.org"; default = "@stunkymonkey-bot:matrix.org"; }; - PasswortFile = mkOption { - type = types.path; + PasswortFile = lib.mkOption { + type = lib.types.path; description = '' Password for the bot. format: MX_TOKEN= ''; example = "/run/secrets/password"; }; - RoomID = mkOption { - type = types.str; + RoomID = lib.mkOption { + type = lib.types.str; description = "Matrix room id."; example = "!abcdefghijklmnopqr:matrix.org"; default = "!ZWnKiKLuQNBkBGMPCl:matrix.org"; diff --git a/modules/services/minecraft-server/default.nix b/modules/services/minecraft-server/default.nix index 576a41e..8fc94fe 100644 --- a/modules/services/minecraft-server/default.nix +++ b/modules/services/minecraft-server/default.nix @@ -9,8 +9,8 @@ let cfg = config.my.services.minecraft-server; in { - options.my.services.minecraft-server = with lib; { - enable = mkEnableOption "Minecraft Server"; + options.my.services.minecraft-server = { + enable = lib.mkEnableOption "Minecraft Server"; }; config = lib.mkIf cfg.enable { diff --git a/modules/services/navidrome/default.nix b/modules/services/navidrome/default.nix index 94165f7..ef64dad 100644 --- a/modules/services/navidrome/default.nix +++ b/modules/services/navidrome/default.nix @@ -10,10 +10,10 @@ let inherit (config.networking) domain; in { - options.my.services.navidrome = with lib; { - enable = mkEnableOption "Navidrome Music Server"; + options.my.services.navidrome = { + enable = lib.mkEnableOption "Navidrome Music Server"; - settings = mkOption { + settings = lib.mkOption { inherit (pkgs.formats.json { }) type; default = { EnableSharing = true; @@ -29,8 +29,8 @@ in ''; }; - musicFolder = mkOption { - type = types.str; + musicFolder = lib.mkOption { + type = lib.types.str; example = "/mnt/music/"; description = "Music folder"; }; diff --git a/modules/services/nextcloud/default.nix b/modules/services/nextcloud/default.nix index 0c333c8..2cdcd13 100644 --- a/modules/services/nextcloud/default.nix +++ b/modules/services/nextcloud/default.nix @@ -10,28 +10,28 @@ let inherit (config.networking) domain; in { - options.my.services.nextcloud = with lib; { - enable = mkEnableOption "Nextcloud"; - maxSize = mkOption { - type = types.str; + options.my.services.nextcloud = { + enable = lib.mkEnableOption "Nextcloud"; + maxSize = lib.mkOption { + type = lib.types.str; default = "10G"; example = "512M"; description = "Maximum file upload size"; }; - admin = mkOption { - type = types.str; + admin = lib.mkOption { + type = lib.types.str; default = "felix"; example = "admin"; description = "Name of the admin user"; }; - default_phone_region = mkOption { - type = types.str; + default_phone_region = lib.mkOption { + type = lib.types.str; default = "DE"; example = "US"; description = "country codes for automatic phone-number "; }; - passwordFile = mkOption { - type = types.path; + passwordFile = lib.mkOption { + type = lib.types.path; example = "/var/lib/nextcloud/password.txt"; description = '' Path to a file containing the admin's password, must be readable by @@ -39,8 +39,8 @@ in ''; }; - exporterPasswordFile = mkOption { - type = types.path; + exporterPasswordFile = lib.mkOption { + type = lib.types.path; example = "/var/lib/nextcloud/password.txt"; description = '' Path to a file containing the admin's password, must be readable by diff --git a/modules/services/node-exporter/default.nix b/modules/services/node-exporter/default.nix index a131215..e3f4648 100644 --- a/modules/services/node-exporter/default.nix +++ b/modules/services/node-exporter/default.nix @@ -10,8 +10,8 @@ let cfg = config.my.services.node-exporter; in { - options.my.services.node-exporter = with lib; { - enable = mkEnableOption "Node-Exporter for monitoring"; + options.my.services.node-exporter = { + enable = lib.mkEnableOption "Node-Exporter for monitoring"; }; config = lib.mkIf cfg.enable { diff --git a/modules/services/paperless/default.nix b/modules/services/paperless/default.nix index e7e231c..31c1662 100644 --- a/modules/services/paperless/default.nix +++ b/modules/services/paperless/default.nix @@ -5,23 +5,23 @@ let inherit (config.networking) domain; in { - options.my.services.paperless = with lib; { - enable = mkEnableOption "Paperless Server"; + options.my.services.paperless = { + enable = lib.mkEnableOption "Paperless Server"; - passwordFile = mkOption { - type = types.path; + passwordFile = lib.mkOption { + type = lib.types.path; description = "Password for the defaultUser for FreshRSS."; example = "/run/secrets/freshrss"; }; - mediaDir = mkOption { - type = types.path; + mediaDir = lib.mkOption { + type = lib.types.path; description = "Location of the FreshRSS data."; example = "/data/docs"; }; - settings = mkOption { - type = types.attrs; + settings = lib.mkOption { + type = lib.types.attrs; default = { }; description = "additional extraConfig"; }; diff --git a/modules/services/passworts/default.nix b/modules/services/passworts/default.nix index e4d0598..e99d6bc 100644 --- a/modules/services/passworts/default.nix +++ b/modules/services/passworts/default.nix @@ -5,10 +5,10 @@ let inherit (config.networking) domain; in { - options.my.services.passworts = with lib; { - enable = mkEnableOption "Passwords Server"; - port = mkOption { - type = types.port; + options.my.services.passworts = { + enable = lib.mkEnableOption "Passwords Server"; + port = lib.mkOption { + type = lib.types.port; default = 5010; example = 8080; description = "Internal port for webui"; diff --git a/modules/services/prometheus/default.nix b/modules/services/prometheus/default.nix index c33d6c9..07c9a0a 100644 --- a/modules/services/prometheus/default.nix +++ b/modules/services/prometheus/default.nix @@ -10,50 +10,50 @@ let inherit (config.networking) domain; in { - options.my.services.prometheus = with lib; { - enable = mkEnableOption "Prometheus for monitoring"; + options.my.services.prometheus = { + enable = lib.mkEnableOption "Prometheus for monitoring"; - scrapeInterval = mkOption { - type = types.str; + scrapeInterval = lib.mkOption { + type = lib.types.str; default = "15s"; example = "1m"; description = "Scrape interval"; }; - retentionTime = mkOption { - type = types.str; + retentionTime = lib.mkOption { + type = lib.types.str; default = "2y"; example = "1m"; description = "retention time"; }; # a good collections for alerts can be found here: https://samber.github.io/awesome-prometheus-alerts/rules#blackbox - rules = mkOption { - type = types.attrsOf ( - types.submodule { + rules = lib.mkOption { + type = lib.types.attrsOf ( + lib.types.submodule { options = { - condition = mkOption { - type = types.str; + condition = lib.mkOption { + type = lib.types.str; description = '' Prometheus alert expression. ''; - example = ''disk_used_percent{mode!="ro"} >= 90''; + example = "up == 0"; default = null; }; - description = mkOption { - type = types.str; + description = lib.mkOption { + type = lib.types.str; description = '' Prometheus alert message. ''; example = "Prometheus encountered value {{ $value }} with {{ $labels }}"; default = null; }; - labels = mkOption { - type = types.nullOr (types.attrsOf types.str); + labels = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.str); description = '' Additional alert labels. ''; - example = literalExpression '' + example = lib.literalExpression '' { severity = "page" }; ''; default = { }; diff --git a/modules/services/promtail/default.nix b/modules/services/promtail/default.nix index 69fc993..cc8374d 100644 --- a/modules/services/promtail/default.nix +++ b/modules/services/promtail/default.nix @@ -5,11 +5,11 @@ let inherit (config.networking) domain; in { - options.my.services.promtail = with lib; { - enable = mkEnableOption "promtail log forwarding"; + options.my.services.promtail = { + enable = lib.mkEnableOption "promtail log forwarding"; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 9081; example = 3002; description = "Internal port"; diff --git a/modules/services/prowlarr/default.nix b/modules/services/prowlarr/default.nix index bd971d7..b4e761a 100644 --- a/modules/services/prowlarr/default.nix +++ b/modules/services/prowlarr/default.nix @@ -7,8 +7,8 @@ let port = 9696; in { - options.my.services.prowlarr = with lib; { - enable = mkEnableOption "Prowlarr for indexing"; + options.my.services.prowlarr = { + enable = lib.mkEnableOption "Prowlarr for indexing"; apiKeyFile = lib.mkOption { type = lib.types.path; diff --git a/modules/services/radarr/default.nix b/modules/services/radarr/default.nix index ae14872..9df7e5d 100644 --- a/modules/services/radarr/default.nix +++ b/modules/services/radarr/default.nix @@ -7,8 +7,8 @@ let port = 7878; in { - options.my.services.radarr = with lib; { - enable = mkEnableOption "Radarr for film management"; + options.my.services.radarr = { + enable = lib.mkEnableOption "Radarr for film management"; apiKeyFile = lib.mkOption { type = lib.types.path; diff --git a/modules/services/sonarr/default.nix b/modules/services/sonarr/default.nix index f7b9150..ffd50ea 100644 --- a/modules/services/sonarr/default.nix +++ b/modules/services/sonarr/default.nix @@ -7,8 +7,8 @@ let port = 8989; in { - options.my.services.sonarr = with lib; { - enable = mkEnableOption "Sonarr for series management"; + options.my.services.sonarr = { + enable = lib.mkEnableOption "Sonarr for series management"; apiKeyFile = lib.mkOption { type = lib.types.path; diff --git a/modules/services/tandoor-recipes/default.nix b/modules/services/tandoor-recipes/default.nix index 3d1b22b..bfda439 100644 --- a/modules/services/tandoor-recipes/default.nix +++ b/modules/services/tandoor-recipes/default.nix @@ -5,8 +5,8 @@ let inherit (config.networking) domain; in { - options.my.services.tandoor-recipes = with lib; { - enable = mkEnableOption "Tandoor Recipes"; + options.my.services.tandoor-recipes = { + enable = lib.mkEnableOption "Tandoor Recipes"; }; config = lib.mkIf cfg.enable { diff --git a/modules/services/vpn/default.nix b/modules/services/vpn/default.nix index 0fc66ab..9ea0db3 100644 --- a/modules/services/vpn/default.nix +++ b/modules/services/vpn/default.nix @@ -5,11 +5,11 @@ let inherit (config.networking) domain; in { - options.my.services.vpn = with lib; { - enable = mkEnableOption "Headscale VPN"; - isMaster = mkEnableOption "Headscale Master"; - port = mkOption { - type = types.port; + options.my.services.vpn = { + enable = lib.mkEnableOption "Headscale VPN"; + isMaster = lib.mkEnableOption "Headscale Master"; + port = lib.mkOption { + type = lib.types.port; default = 8090; example = 8080; description = "Internal port"; diff --git a/modules/system/avahi/default.nix b/modules/system/avahi/default.nix index 68e99cf..d017967 100644 --- a/modules/system/avahi/default.nix +++ b/modules/system/avahi/default.nix @@ -9,8 +9,8 @@ let cfg = config.my.system.avahi; in { - options.my.system.avahi = with lib; { - enable = mkEnableOption "avahi configuration"; + options.my.system.avahi = { + enable = lib.mkEnableOption "avahi configuration"; }; config = lib.mkIf cfg.enable { diff --git a/modules/system/docker/default.nix b/modules/system/docker/default.nix index daded14..5db9f41 100644 --- a/modules/system/docker/default.nix +++ b/modules/system/docker/default.nix @@ -10,8 +10,8 @@ let cfg = config.my.system.docker; in { - options.my.system.docker = with lib; { - enable = mkEnableOption "docker configuration"; + options.my.system.docker = { + enable = lib.mkEnableOption "docker configuration"; }; config = lib.mkIf cfg.enable { diff --git a/modules/system/fonts/default.nix b/modules/system/fonts/default.nix index 02d8f3e..24d3412 100644 --- a/modules/system/fonts/default.nix +++ b/modules/system/fonts/default.nix @@ -8,11 +8,11 @@ let cfg = config.my.system.fonts; in { - options.my.system.fonts = with lib; { - enable = mkEnableOption "fonts configuration"; + options.my.system.fonts = { + enable = lib.mkEnableOption "fonts configuration"; - additionalFonts = mkOption { - type = types.listOf types.package; + additionalFonts = lib.mkOption { + type = lib.types.listOf lib.types.package; default = [ ]; example = "fira"; description = "Which additional fonts should be added as well"; diff --git a/modules/system/kvm/default.nix b/modules/system/kvm/default.nix index 450da3c..a92a49e 100644 --- a/modules/system/kvm/default.nix +++ b/modules/system/kvm/default.nix @@ -3,16 +3,16 @@ let cfg = config.my.system.kvm; in { - options.my.system.kvm = with lib; { - enable = mkEnableOption "kvm configuration"; + options.my.system.kvm = { + enable = lib.mkEnableOption "kvm configuration"; - cpuFlavor = mkOption { - type = - with types; - nullOr (enum [ + cpuFlavor = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ "intel" "amd" - ]); + ] + ); default = null; example = "intel"; description = "Which kind of CPU to activate kernelModules"; diff --git a/modules/system/miracast/default.nix b/modules/system/miracast/default.nix index 5386601..815e1cc 100644 --- a/modules/system/miracast/default.nix +++ b/modules/system/miracast/default.nix @@ -10,8 +10,8 @@ let cfg = config.my.system.miracast; in { - options.my.system.miracast = with lib; { - enable = mkEnableOption "miracast configuration"; + options.my.system.miracast = { + enable = lib.mkEnableOption "miracast configuration"; }; config = lib.mkIf cfg.enable { diff --git a/modules/system/podman/default.nix b/modules/system/podman/default.nix index cb75f6d..d611854 100644 --- a/modules/system/podman/default.nix +++ b/modules/system/podman/default.nix @@ -10,8 +10,8 @@ let cfg = config.my.system.podman; in { - options.my.system.podman = with lib; { - enable = mkEnableOption "podman configuration"; + options.my.system.podman = { + enable = lib.mkEnableOption "podman configuration"; }; config = lib.mkIf cfg.enable { diff --git a/modules/system/spell-check/default.nix b/modules/system/spell-check/default.nix index dc90ef4..4d8f653 100644 --- a/modules/system/spell-check/default.nix +++ b/modules/system/spell-check/default.nix @@ -10,8 +10,8 @@ let cfg = config.my.system.spell-check; in { - options.my.system.spell-check = with lib; { - enable = mkEnableOption "spell-check configuration"; + options.my.system.spell-check = { + enable = lib.mkEnableOption "spell-check configuration"; }; config = lib.mkIf cfg.enable { diff --git a/profiles/3d-design/default.nix b/profiles/3d-design/default.nix index 45cd6e7..aa793ef 100644 --- a/profiles/3d-design/default.nix +++ b/profiles/3d-design/default.nix @@ -8,8 +8,8 @@ let cfg = config.my.profiles."3d-design"; in { - options.my.profiles."3d-design" = with lib; { - enable = mkEnableOption "3d-design profile"; + options.my.profiles."3d-design" = { + enable = lib.mkEnableOption "3d-design profile"; }; config = lib.mkIf cfg.enable { diff --git a/profiles/android/default.nix b/profiles/android/default.nix index 9f1fd98..1314052 100644 --- a/profiles/android/default.nix +++ b/profiles/android/default.nix @@ -8,8 +8,8 @@ let cfg = config.my.profiles.android; in { - options.my.profiles.android = with lib; { - enable = mkEnableOption "android profile"; + options.my.profiles.android = { + enable = lib.mkEnableOption "android profile"; }; config = lib.mkIf cfg.enable { diff --git a/profiles/clean/default.nix b/profiles/clean/default.nix index ff12b69..02374a8 100644 --- a/profiles/clean/default.nix +++ b/profiles/clean/default.nix @@ -8,8 +8,8 @@ let cfg = config.my.profiles.clean; in { - options.my.profiles.clean = with lib; { - enable = mkEnableOption "clean profile"; + options.my.profiles.clean = { + enable = lib.mkEnableOption "clean profile"; }; config = lib.mkIf cfg.enable { diff --git a/profiles/desktop-apps/default.nix b/profiles/desktop-apps/default.nix index 8b75a25..8c62e85 100644 --- a/profiles/desktop-apps/default.nix +++ b/profiles/desktop-apps/default.nix @@ -8,8 +8,8 @@ let cfg = config.my.profiles.desktop-apps; in { - options.my.profiles.desktop-apps = with lib; { - enable = mkEnableOption "desktop-apps profile"; + options.my.profiles.desktop-apps = { + enable = lib.mkEnableOption "desktop-apps profile"; }; config = lib.mkIf cfg.enable { diff --git a/profiles/desktop-dev/default.nix b/profiles/desktop-dev/default.nix index 4fe26ef..e1c0599 100644 --- a/profiles/desktop-dev/default.nix +++ b/profiles/desktop-dev/default.nix @@ -8,8 +8,8 @@ let cfg = config.my.profiles.desktop-dev; in { - options.my.profiles.desktop-dev = with lib; { - enable = mkEnableOption "desktop-dev profile"; + options.my.profiles.desktop-dev = { + enable = lib.mkEnableOption "desktop-dev profile"; }; config = lib.mkIf cfg.enable { diff --git a/profiles/development/default.nix b/profiles/development/default.nix index 6c19661..cc5e74a 100644 --- a/profiles/development/default.nix +++ b/profiles/development/default.nix @@ -8,8 +8,8 @@ let cfg = config.my.profiles.development; in { - options.my.profiles.development = with lib; { - enable = mkEnableOption "development profile"; + options.my.profiles.development = { + enable = lib.mkEnableOption "development profile"; }; config = lib.mkIf cfg.enable {