mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
project-wide: A move to targets, getting closer to production
This commit is contained in:
parent
bcfdc68b30
commit
1ce1328695
16 changed files with 150 additions and 110 deletions
|
|
@ -9,7 +9,7 @@ rec {
|
|||
|
||||
hostConfig = hostName:
|
||||
{ config, ... }: {
|
||||
_module.args = { inherit hosts groups; };
|
||||
_module.args = { inherit hosts targets; };
|
||||
imports = [ ../nixos.nix ../modules/nixos ];
|
||||
networking = { inherit hostName; };
|
||||
nixpkgs.pkgs = import pkgsPath {
|
||||
|
|
@ -30,11 +30,6 @@ rec {
|
|||
specialArgs = { inherit sources tf profiles witch hostName; };
|
||||
})) hostNames);
|
||||
|
||||
groupNames = unique (concatLists
|
||||
(mapAttrsToList (name: host: host.config.deploy.groups) hosts));
|
||||
|
||||
groups = listToAttrs (map (groupName:
|
||||
nameValuePair groupName (attrNames
|
||||
(filterAttrs (name: host: elem groupName host.config.deploy.groups)
|
||||
hosts))) groupNames);
|
||||
targets = foldAttrs (host: hosts: [ host ] ++ hosts) [ ] (mapAttrsToList
|
||||
(hostName: host: { ${host.config.deploy.target} = hostName; }) hosts);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue