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;
cfg = config.services.gatus;
endpointModule = {name, lib, ...}: let
endpointModule = {
name,
lib,
...
}: let
inherit (lib) types;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.modules) mkOptionDefault;
@ -201,34 +205,37 @@
};
in {
options.services.gatus = let
settingsModule = { ... }: {
settingsModule = {...}: {
options = with types; {
/*endpoints = mkOption {
/*
endpoints = mkOption {
type = listOf unspecified;
#type = attrsOf (submodule endpointModule);
#default = {};
};*/
};
*/
};
};
in with types; {
hardening = {
enable = mkEnableOption "sandbox and harden service";
icmp.enable = mkEnableOption "needed for ICMP probes";
};
user = mkOption {
type = nullOr str;
default = null;
};
in
with types; {
hardening = {
enable = mkEnableOption "sandbox and harden service";
icmp.enable = mkEnableOption "needed for ICMP probes";
};
user = mkOption {
type = nullOr str;
default = null;
};
endpoints = mkOption {
type = attrsOf (submodule endpointModule);
default = {};
};
endpoints = mkOption {
type = attrsOf (submodule endpointModule);
default = {};
};
settings = mkOption {
type = submodule settingsModule;
settings = mkOption {
type = submodule settingsModule;
};
};
};
config = let
conf.assertions = let
@ -278,8 +285,9 @@ in {
RestrictSUIDSGID = true;
UMask = "0077";
};
in mkMerge [
(mkIf cfg.enable conf)
serviceConf
];
in
mkMerge [
(mkIf cfg.enable conf)
serviceConf
];
}

View file

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

View file

@ -202,13 +202,14 @@
vouch.requireAuth = mkAlmostOptionDefault true;
};
${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";
in {
xvars.enable = true;
return = mkDefault "303 '${loginUrl}'";
};
in mkIf (cfg.auth.errorLocation != null) errorLocation;
in
mkIf (cfg.auth.errorLocation != null) errorLocation;
${cfg.auth.requestLocation} = {
config,
xvars,