mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
project-wide: Accessing tf config from NixOS now possible
This commit is contained in:
parent
1ce1328695
commit
74cee01680
4 changed files with 6 additions and 5 deletions
|
|
@ -9,7 +9,7 @@ rec {
|
|||
|
||||
hosts = import ./lib/hosts.nix {
|
||||
inherit pkgs sources witch profiles;
|
||||
inherit (deploy) tf;
|
||||
inherit (deploy) target;
|
||||
};
|
||||
|
||||
inherit (pkgs) lib;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, pkgs, lib, profiles, sources, witch, ... }:
|
||||
{ tf, config, pkgs, lib, profiles, sources, witch, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, tf, hostsDir ? ../hosts, profiles, pkgsPath ? ../pkgs, sources ? { }
|
||||
{ pkgs, target, hostsDir ? ../hosts, profiles, pkgsPath ? ../pkgs, sources ? { }
|
||||
, witch ? { } }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
|
@ -27,7 +27,7 @@ rec {
|
|||
else
|
||||
{ })
|
||||
];
|
||||
specialArgs = { inherit sources tf profiles witch hostName; };
|
||||
specialArgs = { inherit sources target profiles witch hostName; };
|
||||
})) hostNames);
|
||||
|
||||
targets = foldAttrs (host: hosts: [ host ] ++ hosts) [ ] (mapAttrsToList
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, ... }:
|
||||
{ tf, target, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.deploy.tf;
|
||||
|
|
@ -26,5 +26,6 @@ in {
|
|||
attrs = [ "out" "attrs" ];
|
||||
out.set = removeAttrs cfg cfg.attrs;
|
||||
};
|
||||
_module.args.tf = target.${config.deploy.target};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue