Compare commits

..

8 commits

Author SHA1 Message Date
538d000575 WIP: WAITING FOR NIXPKS UPDATE
Some checks failed
ci/woodpecker/push/check Pipeline failed
2023-12-25 19:55:20 +01:00
4c8f245ffc hosts: nixos: porthos: services: enable pyload 2023-12-25 19:55:20 +01:00
8a609d95ca hosts: nixos: porthos: secrets: add pyload creds 2023-12-25 19:55:20 +01:00
a031ad43d7 nixos: services: add pyload 2023-12-25 19:55:19 +01:00
e2c903a88b nixos: services: nginx: fix SSO subdomain 2023-12-25 19:54:57 +01:00
5ef3c1220e nixos: services: remove redundant subdomains
See previous commit for the defaults.
2023-12-25 19:54:57 +01:00
6ab27739a6 nixos: services: nginx: add default subdomain
In almost all cases, the subdomain should be the same as the attribute
name...
2023-12-25 19:54:57 +01:00
14a7ffa890 nixos: services: nginx: use attrset for vhosts
Attribute sets compose better than lists, it was a mistake to use a list
in the first place...
2023-12-25 19:54:57 +01:00

View file

@ -189,7 +189,7 @@ in
config = lib.mkIf cfg.enable {
assertions = [ ]
++ (lib.flip lib.mapAttrsToList cfg.virtualHosts (_: { subdomain, ... } @ args:
++ (lib.flip lib.mapAttrsToList cfg.virtualHosts ({ subdomain, ... } @ args:
let
conflicts = [ "port" "root" "socket" "redirect" ];
optionsNotNull = builtins.map (v: args.${v} != null) conflicts;
@ -220,7 +220,7 @@ in
map mkAssertion nonUniques
) ++ (
let
subs = lib.mapAttrsToList (_: { subdomain, ... }: subdomain) cfg.virtualHosts;
subs = lib.mapAttrsToList ({ subdomain, ... }: subdomain) cfg.virtualHosts;
subsCounts = lib.my.countValues subs;
nonUniquesCounts = lib.filterAttrs (_: v: v != 1) subsCounts;
nonUniques = builtins.attrNames nonUniquesCounts;