chore: nf-fmt-nix

This commit is contained in:
arcnmx 2024-11-24 15:42:39 -08:00
parent 179ac7ac55
commit 21ed969ab7
7 changed files with 52 additions and 37 deletions

View file

@ -11,7 +11,11 @@
inherit (lib) types; inherit (lib) types;
cfg = config.services.gatus; cfg = config.services.gatus;
endpointModule = {name, lib, ...}: let endpointModule = {
name,
lib,
...
}: let
inherit (lib) types; inherit (lib) types;
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.modules) mkOptionDefault; inherit (lib.modules) mkOptionDefault;
@ -201,16 +205,19 @@
}; };
in { in {
options.services.gatus = let options.services.gatus = let
settingsModule = { ... }: { settingsModule = {...}: {
options = with types; { options = with types; {
/*endpoints = mkOption { /*
endpoints = mkOption {
type = listOf unspecified; type = listOf unspecified;
#type = attrsOf (submodule endpointModule); #type = attrsOf (submodule endpointModule);
#default = {}; #default = {};
};*/ };
*/
}; };
}; };
in with types; { in
with types; {
hardening = { hardening = {
enable = mkEnableOption "sandbox and harden service"; enable = mkEnableOption "sandbox and harden service";
icmp.enable = mkEnableOption "needed for ICMP probes"; icmp.enable = mkEnableOption "needed for ICMP probes";
@ -278,7 +285,8 @@ in {
RestrictSUIDSGID = true; RestrictSUIDSGID = true;
UMask = "0077"; UMask = "0077";
}; };
in mkMerge [ in
mkMerge [
(mkIf cfg.enable conf) (mkIf cfg.enable conf)
serviceConf serviceConf
]; ];

View file

@ -242,7 +242,9 @@ in {
]); ]);
}); });
env-canada = super.env-canada.overridePythonAttrs (old: { env-canada = super.env-canada.overridePythonAttrs (old: {
dependencies = old.dependencies ++ [ dependencies =
old.dependencies
++ [
self.defusedxml self.defusedxml
]; ];
}); });

View file

@ -202,13 +202,14 @@
vouch.requireAuth = mkAlmostOptionDefault true; vouch.requireAuth = mkAlmostOptionDefault true;
}; };
${cfg.auth.errorLocation} = let ${cfg.auth.errorLocation} = let
errorLocation = { xvars, ... }: let errorLocation = {xvars, ...}: let
loginUrl = "$vouch_url/login?url=${xvars.get.scheme}://${xvars.get.host}$request_uri&X-Vouch-Token=$auth_resp_jwt&error=$auth_resp_err"; loginUrl = "$vouch_url/login?url=${xvars.get.scheme}://${xvars.get.host}$request_uri&X-Vouch-Token=$auth_resp_jwt&error=$auth_resp_err";
in { in {
xvars.enable = true; xvars.enable = true;
return = mkDefault "303 '${loginUrl}'"; return = mkDefault "303 '${loginUrl}'";
}; };
in mkIf (cfg.auth.errorLocation != null) errorLocation; in
mkIf (cfg.auth.errorLocation != null) errorLocation;
${cfg.auth.requestLocation} = { ${cfg.auth.requestLocation} = {
config, config,
xvars, xvars,

View file

@ -18,11 +18,13 @@
grocy.config = config.services.grocy; grocy.config = config.services.grocy;
barcodebuddy.config = config.services.barcodebuddy; barcodebuddy.config = config.services.barcodebuddy;
# XXX: kanidm currently unused # XXX: kanidm currently unused
/*kanidm = { /*
kanidm = {
config = config.services.kanidm; config = config.services.kanidm;
enable = config.services.kanidm.enableServer; enable = config.services.kanidm.enableServer;
subpath = "kanidm/kanidm.db"; subpath = "kanidm/kanidm.db";
};*/ };
*/
mosquitto.config = config.services.mosquitto; mosquitto.config = config.services.mosquitto;
plex = { plex = {
config = config.services.plex; config = config.services.plex;

View file

@ -210,7 +210,8 @@ in {
name = "Gatus Logs"; name = "Gatus Logs";
link = "${grafana.link}/d/ae4jrpnh74ohsa/gatus"; link = "${grafana.link}/d/ae4jrpnh74ohsa/gatus";
}; };
in mkMerge [ in
mkMerge [
[grafana prometheus] [grafana prometheus]
(mkAfter [gatusLogs]) (mkAfter [gatusLogs])
]; ];

View file

@ -17,7 +17,8 @@ in {
nixpkgs = import gensokyo-zone.inputs.nixpkgs-2405 { nixpkgs = import gensokyo-zone.inputs.nixpkgs-2405 {
inherit (pkgs) system config; inherit (pkgs) system config;
}; };
in mkDefault nixpkgs.mongodb-5_0; in
mkDefault nixpkgs.mongodb-5_0;
}; };
networking.firewall = mkIf cfg.enable { networking.firewall = mkIf cfg.enable {