Compare commits

..

8 commits

Author SHA1 Message Date
99cdb697f1 WIP: WAITING FOR NIXPKS UPDATE
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2023-12-25 20:21:00 +01:00
8c932d159e hosts: nixos: porthos: services: enable pyload 2023-12-25 20:20:59 +01:00
cd96ffe5ee hosts: nixos: porthos: secrets: add pyload creds 2023-12-25 20:20:59 +01:00
e42d611eba nixos: services: add pyload 2023-12-25 20:20:59 +01:00
a3c2135c26 nixos: services: nginx: fix SSO subdomain 2023-12-25 20:20:50 +01:00
c2867b3483 nixos: services: remove redundant subdomains
See previous commit for the defaults.
2023-12-25 20:20:50 +01:00
5572b7b049 nixos: services: nginx: add default subdomain
In almost all cases, the subdomain should be the same as the attribute
name...
2023-12-25 20:20:50 +01:00
5d612efb6c 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 20:20:50 +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;