chore: reformat codebase

This commit is contained in:
Gabriel Arazas 2023-12-13 11:28:45 +08:00
parent a526f5d505
commit 3714f843d0
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
5 changed files with 41 additions and 37 deletions

View File

@ -376,7 +376,7 @@
lib'.mapAttrs lib'.mapAttrs
(host: metadata: (host: metadata:
mkHost { mkHost {
extraModules = [(hostSpecificModule host metadata)]; extraModules = [ (hostSpecificModule host metadata) ];
system = metadata._system; system = metadata._system;
nixpkgs-channel = metadata.nixpkgs-channel or "nixpkgs"; nixpkgs-channel = metadata.nixpkgs-channel or "nixpkgs";
}) })
@ -454,7 +454,7 @@
in in
lib'.nameValuePair name (mkImage { lib'.nameValuePair name (mkImage {
inherit format system pkgs; inherit format system pkgs;
extraModules = [(hostSpecificModule host metadata)]; extraModules = [ (hostSpecificModule host metadata) ];
})) }))
images'); images');

View File

@ -177,13 +177,14 @@ in
zone services; zone services;
keepalive 2; keepalive 2;
''; '';
servers = let servers =
address = config.services.vaultwarden.config.ROCKET_ADDRESS; let
port = config.services.vaultwarden.config.ROCKET_PORT; address = config.services.vaultwarden.config.ROCKET_ADDRESS;
in port = config.services.vaultwarden.config.ROCKET_PORT;
{ in
"${address}:${builtins.toString port}" = { }; {
}; "${address}:${builtins.toString port}" = { };
};
}; };
}) })

View File

@ -13,16 +13,18 @@ in
config = lib.mkIf cfg.enable (lib.mkMerge [ config = lib.mkIf cfg.enable (lib.mkMerge [
{ {
sops.secrets = let sops.secrets =
vouchPermissions = rec { let
owner = "vouch-proxy"; vouchPermissions = rec {
group = owner; owner = "vouch-proxy";
mode = "0400"; group = owner;
mode = "0400";
};
in
lib.getSecrets ../../secrets/secrets.yaml {
"vouch-proxy/jwt/secret" = vouchPermissions;
"vouch-proxy/client/secret" = vouchPermissions;
}; };
in lib.getSecrets ../../secrets/secrets.yaml {
"vouch-proxy/jwt/secret" = vouchPermissions;
"vouch-proxy/client/secret" = vouchPermissions;
};
services.vouch-proxy = { services.vouch-proxy = {
enable = true; enable = true;

View File

@ -8,18 +8,19 @@ let
# values with shell expansions. # values with shell expansions.
toDistroboxConf = lib.generators.toKeyValue { toDistroboxConf = lib.generators.toKeyValue {
listsAsDuplicateKeys = false; listsAsDuplicateKeys = false;
mkKeyValue = lib.generators.mkKeyValueDefault { mkKeyValue = lib.generators.mkKeyValueDefault
mkValueString = v: {
if v == true then "1" mkValueString = v:
else if v == false then "0" if v == true then "1"
else if lib.isString v then ''"${v}"'' else if v == false then "0"
else if lib.isPath v then lib.escapeShellArg v else if lib.isString v then ''"${v}"''
else if lib.isList v then ''"${lib.concatStringsSep " " v}"'' else if lib.isPath v then lib.escapeShellArg v
else lib.generators.mkValueStringDefault { } v; else if lib.isList v then ''"${lib.concatStringsSep " " v}"''
} "="; else lib.generators.mkValueStringDefault { } v;
} "=";
}; };
distroboxConf = { }: { distroboxConf = {}: {
type = with lib.types; type = with lib.types;
let let
valueType = (oneOf [ valueType = (oneOf [

View File

@ -49,7 +49,7 @@ let
after = [ "network.target" ]; after = [ "network.target" ];
documentation = [ "https://docs.archivebox.io/" ]; documentation = [ "https://docs.archivebox.io/" ];
preStart = '' preStart = ''
mkdir -p ${lib.escapeShellArg cfg.archivePath} mkdir -p ${lib.escapeShellArg cfg.archivePath}
''; '';
path = [ cfg.package ] ++ cfg.extraPackages; path = [ cfg.package ] ++ cfg.extraPackages;
script = '' script = ''
@ -96,14 +96,14 @@ let
lib.nameValuePair (jobUnitName name) { lib.nameValuePair (jobUnitName name) {
description = description =
"Archivebox download job '${name}'"; "Archivebox download job '${name}'";
after = [ "network.target" ]; after = [ "network.target" ];
documentation = [ "https://docs.archivebox.io/" ]; documentation = [ "https://docs.archivebox.io/" ];
timerConfig = { timerConfig = {
Persistent = true; Persistent = true;
OnCalendar = value.startAt; OnCalendar = value.startAt;
RandomizedDelaySec = 120; RandomizedDelaySec = 120;
}; };
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
}; };
in in
{ {