Added helper to get domains for local network

This commit is contained in:
alejandro-angulo 2025-05-04 19:23:19 -07:00
parent ab3c1bf1ca
commit f7b085b73e
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
2 changed files with 20 additions and 0 deletions

View file

@ -105,6 +105,13 @@
}; };
}; };
# nix eval .#domains --json
domains = inputs.self.lib.getDomainsPerHost [
"gospel"
"node"
"pi4"
] inputs.self.nixosConfigurations;
# TODO: Re-enable this when I figure out how to prevent needing to build # TODO: Re-enable this when I figure out how to prevent needing to build
# dependencies for architectures other than the host machine # dependencies for architectures other than the host machine
# checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks inputs.self.deploy) inputs.deploy-rs.lib; # checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks inputs.self.deploy) inputs.deploy-rs.lib;

13
lib/helpers/default.nix Normal file
View file

@ -0,0 +1,13 @@
{
lib,
...
}:
rec {
getValues = keys: attrs: lib.attrsets.filterAttrs (name: value: builtins.elem name keys) attrs;
getDomainNames =
cfgs:
lib.attrsets.mapAttrs (name: cfg: builtins.attrNames cfg.config.services.nginx.virtualHosts) cfgs;
getDomainsPerHost = systemNames: nixosConfigs: getDomainNames (getValues systemNames nixosConfigs);
}