Format project using nixfmt rfc candidate.

This commit is contained in:
Kevin Baensch 2024-11-20 20:32:38 +01:00
parent 1f63817684
commit a9f7fe416f
Signed by: derped
GPG key ID: C0F1D326C7626543
91 changed files with 1347 additions and 1000 deletions

View file

@ -15,28 +15,35 @@
}:
with lib;
with builtins;
mkIf (elem "nginx" config.machine.services) {
services.nginx = let
vHostConfigs = listToAttrs (map
(name: {
name = replaceStrings [".nix"] [""] name;
value = import (./. + (toPath "/nginx_vHosts/${name}")) {inherit options config lib pkgs;};
})
(attrNames (readDir ./nginx_vHosts)));
mkIf (elem "nginx" config.machine.services) {
services.nginx =
let
vHostConfigs = listToAttrs (
map (name: {
name = replaceStrings [ ".nix" ] [ "" ] name;
value = import (./. + (toPath "/nginx_vHosts/${name}")) {
inherit
options
config
lib
pkgs
;
};
}) (attrNames (readDir ./nginx_vHosts))
);
mkVHost = vHost: {
name = vHost.domain;
value =
{
enableACME = true;
forceSSL = true;
acmeRoot = "/var/lib/acme/acme-challenge";
}
// vHostConfigs."${vHost.service}";
value = {
enableACME = true;
forceSSL = true;
acmeRoot = "/var/lib/acme/acme-challenge";
} // vHostConfigs."${vHost.service}";
};
vHosts = listToAttrs (map mkVHost config.machine.vHosts);
in {
in
{
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
@ -56,4 +63,4 @@ with builtins;
'';
virtualHosts = vHosts;
};
}
}