diff --git a/config/modules/home/default.nix b/config/modules/home/default.nix index 2c36e19b..6d00dbf2 100644 --- a/config/modules/home/default.nix +++ b/config/modules/home/default.nix @@ -4,7 +4,7 @@ disabledModules = [ "programs/vim.nix" ]; imports = with (import (sources.nixexprs + "/modules")).home-manager; [ base16 syncplay konawall i3gopher weechat shell ] ++ [ ./vim.nix - ./deploy-tf + ./deploy-tf.nix (sources.tf-nix + "/modules/home/secrets.nix") ]; } diff --git a/config/modules/home/deploy-tf/default.nix b/config/modules/home/deploy-tf.nix similarity index 100% rename from config/modules/home/deploy-tf/default.nix rename to config/modules/home/deploy-tf.nix diff --git a/config/modules/meta/deploy-old.nix b/config/modules/meta/deploy-old.nix deleted file mode 100644 index 56bff7a0..00000000 --- a/config/modules/meta/deploy-old.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ tf, target, 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.target = mkOption { - type = with types; str; - default = ""; - }; - - 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 = mkMerge (singleton - { - attrs = [ "out" "attrs" ]; - out.set = removeAttrs cfg cfg.attrs; - deploy.systems.${config.networking.hostName} = - with tf.resources; { - isRemote = - (config.networking.hostName != builtins.getEnv "HOME_HOSTNAME"); - nixosConfig = config; - connection = tf.resources.${config.networking.hostName}.connection.set; - triggers.copy.${config.networking.hostName} = - tf.resources.${config.networking.hostName}.refAttr "id"; - triggers.secrets.${config.networking.hostName} = - tf.resources.${config.networking.hostName}.refAttr "id"; - }; - - dns.records."kittywitch_net_${config.networking.hostName}" = - mkIf (config.hexchen.network.enable) { - tld = "kittywit.ch."; - domain = "${config.networking.hostName}.net"; - aaaa.address = config.hexchen.network.address; - }; - - } ++ mapAttrsToList - (_: user: - mapAttrs (_: mkMerge) user.deploy.tf.out.set) - config.home-manager.users); - - security.acme.certs."${config.networking.hostName}.net.kittywit.ch" = - mkIf (config.services.nginx.enable && config.hexchen.network.enable) { - domain = "${config.networking.hostName}.net.kittywit.ch"; - dnsProvider = "rfc2136"; - credentialsFile = config.secrets.files.dns_creds.path; - group = "nginx"; - }; - - _module.args.tf = target.${config.deploy.target}; - }; -}