diff options
| author | Jakub Stachurski <j.stachurski@student.utwente.nl> | 2026-02-11 15:36:27 +0100 |
|---|---|---|
| committer | Jakub Stachurski <j.stachurski@student.utwente.nl> | 2026-02-11 15:36:27 +0100 |
| commit | f373e772781c9d1cdbe2f97ef3791a7b41ac0657 (patch) | |
| tree | 7087dc65362f37b0ef6b85ac9e46a66fc491af1a /services | |
| parent | 04707c728441000d64d3d750916354310ff2d2ab (diff) | |
Nixfmt
Diffstat (limited to 'services')
| -rw-r--r-- | services/email.nix | 64 | ||||
| -rw-r--r-- | services/freshrss.nix | 2 | ||||
| -rw-r--r-- | services/mysql.nix | 12 | ||||
| -rw-r--r-- | services/uptimekuma.nix | 10 |
4 files changed, 51 insertions, 37 deletions
diff --git a/services/email.nix b/services/email.nix index 906b44d..3f7cb9f 100644 --- a/services/email.nix +++ b/services/email.nix @@ -93,28 +93,40 @@ in uri: (makeHttpRedirect "${cfg.domain}${uri}") cfg.doACME )); }) - )) // - { ${cfg.domain} = { - addSSL = cfg.doACME; - enableACME = cfg.doACME; - serverName = "${cfg.domain}"; - locations."/" = { - proxyPass = "http://localhost:3080"; - recommendedProxySettings = true; - }; - };}; + )) + // { + ${cfg.domain} = { + addSSL = cfg.doACME; + enableACME = cfg.doACME; + serverName = "${cfg.domain}"; + locations."/" = { + proxyPass = "http://localhost:3080"; + recommendedProxySettings = true; + }; + }; + }; services.stalwart = { enable = true; dataDir = cfg.dataDir; openFirewall = false; - credentials = (lib.genAttrs secrets toCredfilePath) // (let - acme_dir = config.security.acme.certs.${cfg.domain}.directory; - cert_path = file: "${acme_dir}/${file}"; - in (if cfg.doACME then { - "tls_cert.pem" = cert_path "cert.pem"; - "tls_key.pem" = cert_path "key.pem"; - } else {})); + credentials = + (lib.genAttrs secrets toCredfilePath) + // ( + let + acme_dir = config.security.acme.certs.${cfg.domain}.directory; + cert_path = file: "${acme_dir}/${file}"; + in + ( + if cfg.doACME then + { + "tls_cert.pem" = cert_path "cert.pem"; + "tls_key.pem" = cert_path "key.pem"; + } + else + { } + ) + ); settings = { server.listener = { @@ -156,17 +168,17 @@ in url = "protocol + \"://${cfg.domain}\""; }; - session.connect = { - hostname = "config_get('server.hostname')"; - }; + session.connect = { + hostname = "config_get('server.hostname')"; + }; - server.hostname = "${cfg.domain}"; + server.hostname = "${cfg.domain}"; - certificate."nix_${cfg.domain}" = lib.mkIf cfg.doACME { - cert = toStalwartCred "tls_cert.pem"; - private-key = toStalwartCred "tls_key.pem"; - default = true; - }; + certificate."nix_${cfg.domain}" = lib.mkIf cfg.doACME { + cert = toStalwartCred "tls_cert.pem"; + private-key = toStalwartCred "tls_key.pem"; + default = true; + }; }; }; } diff --git a/services/freshrss.nix b/services/freshrss.nix index 26a1853..fb20ce8 100644 --- a/services/freshrss.nix +++ b/services/freshrss.nix @@ -59,7 +59,7 @@ in enable = true; users."freshrss" = { sopsPlaceholder = config.sops.placeholder."fresh-rss/db_pass"; - host = "localhost"; + host = "localhost"; }; databases."freshrss" = { enable = true; diff --git a/services/mysql.nix b/services/mysql.nix index 06edfcb..1c0a785 100644 --- a/services/mysql.nix +++ b/services/mysql.nix @@ -26,7 +26,9 @@ let ALTER USER IF EXISTS '${name}'@'${ucfg.host}' IDENTIFIED BY '${ucfg.sopsPlaceholder}'; CREATE USER IF NOT EXISTS '${name}'@'${ucfg.host}' IDENTIFIED BY '${ucfg.sopsPlaceholder}'; '' - + (lib.concatMapAttrsStringSep "\n" (priviledge_clause "'${name}'@'${ucfg.host}'") (create_users_ensure name)) + + (lib.concatMapAttrsStringSep "\n" (priviledge_clause "'${name}'@'${ucfg.host}'") ( + create_users_ensure name + )) ) else " -- Ommitted user ${name}"; @@ -84,10 +86,10 @@ in allowedRanges = mkOption { type = types.listOf types.str; }; - host = mkOption { - type = types.str; - default = "%"; - }; + host = mkOption { + type = types.str; + default = "%"; + }; }; } ); diff --git a/services/uptimekuma.nix b/services/uptimekuma.nix index 720040d..f35b469 100644 --- a/services/uptimekuma.nix +++ b/services/uptimekuma.nix @@ -67,12 +67,12 @@ in services.uptime-kuma = { enable = true; settings = { - UPTIME_KUMA_PORT = "3111"; - UPTIME_KUMA_HOST = "127.0.0.1"; - UPTIME_KUMA_DB_TYPE = "sqlite"; + UPTIME_KUMA_PORT = "3111"; + UPTIME_KUMA_HOST = "127.0.0.1"; + UPTIME_KUMA_DB_TYPE = "sqlite"; #UPTIME_KUMA_DB_SOCKET = "/run/mysqld/mysqld.sock"; - #UPTIME_KUMA_DB_USERNAME = config.systemd.services.uptime-kuma.serviceConfig.User; - #UPTIME_KUMA_DB_NAME = "uptimekuma"; + #UPTIME_KUMA_DB_USERNAME = config.systemd.services.uptime-kuma.serviceConfig.User; + #UPTIME_KUMA_DB_NAME = "uptimekuma"; }; }; }); |
