diff --git a/hosts/blacksteel/default.nix b/hosts/blacksteel/default.nix index 522dff0..419f8b7 100644 --- a/hosts/blacksteel/default.nix +++ b/hosts/blacksteel/default.nix @@ -72,8 +72,7 @@ services.caddy = { enable = true; - configFile = pkgs.substituteAll { - src = ./Caddyfile; + configFile = pkgs.replaceVars ./Caddyfile { robots = toString ../tyo0/robots.txt; inherit (pkgs) mastodon; }; diff --git a/hosts/tyo0/default.nix b/hosts/tyo0/default.nix index 0f10f99..b017411 100644 --- a/hosts/tyo0/default.nix +++ b/hosts/tyo0/default.nix @@ -67,9 +67,7 @@ services.caddy = { enable = true; - configFile = pkgs.substituteAll { - src = ./Caddyfile; - + configFile = pkgs.replaceVars ./Caddyfile { "element" = pkgs.element-web.override { element-web-unwrapped = pkgs.element-web-unwrapped.overrideAttrs (oldAttrs: { version = "1.11.74-rc.0"; @@ -93,8 +91,6 @@ homeserverList = ["ny4.dev"]; }; }; - - "mastodon" = pkgs.mastodon; }; }; diff --git a/nixos/profiles/opt-in/mihomo/default.nix b/nixos/profiles/opt-in/mihomo/default.nix index d019ace..9196420 100644 --- a/nixos/profiles/opt-in/mihomo/default.nix +++ b/nixos/profiles/opt-in/mihomo/default.nix @@ -37,24 +37,13 @@ "clash/proxy-providers/spcloud" = {}; }; - # why not substituteAll? see https://github.com/NixOS/nixpkgs/issues/237216 - sops.templates."clash.yaml".file = let - substituteAll' = {src, ...} @ args: let - args' = lib.removeAttrs args ["src"]; - in - pkgs.substitute { - inherit src; - substitutions = lib.flatten (lib.mapAttrsToList (n: v: ["--subst-var-by" n v]) args'); - }; - in - substituteAll' { - src = ./config.yaml; - inherit - (config.sops.placeholder) - "clash/secret" - "clash/proxies/lightsail" - "clash/proxy-providers/efcloud" - "clash/proxy-providers/spcloud" - ; - }; + sops.templates."clash.yaml".file = pkgs.replaceVars ./config.yaml { + inherit + (config.sops.placeholder) + "clash/secret" + "clash/proxies/lightsail" + "clash/proxy-providers/efcloud" + "clash/proxy-providers/spcloud" + ; + }; }