project-wide: Working DNS setup + referencing tf.nix from hostConfig

This commit is contained in:
kat witch 2021-03-30 02:58:10 +01:00
parent 92c12dd991
commit 2eb84e4654
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
6 changed files with 43 additions and 9 deletions

View file

@ -3,6 +3,7 @@
{
imports = [
./deploy
./tf-glue
(sources.tf-nix + "/modules/nixos/secrets.nix")
(sources.tf-nix + "/modules/nixos/secrets-users.nix")
];

View file

@ -0,0 +1,30 @@
{ config, lib, ... }: with lib; let
cfg = config.deploy.tf;
unmergedValues = types.mkOptionType {
name = "unmergedValues";
merge = loc: defs: map (def: def.value) defs;
};
in {
options.deploy.tf = mkOption {
type = types.submodule {
freeformType = types.attrsOf unmergedValues;
options = {
attrs = mkOption {
type = types.listOf types.str;
default = [ ];
};
out.set = mkOption {
type = types.unspecified;
};
};
};
};
config = {
deploy.tf = {
attrs = [ "out" "attrs" ];
out.set = removeAttrs cfg cfg.attrs;
};
};
}