treewide: use replaceVars
This commit is contained in:
parent
c1920e0036
commit
7ab4a7ba9e
3 changed files with 11 additions and 27 deletions
|
@ -72,8 +72,7 @@
|
||||||
|
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configFile = pkgs.substituteAll {
|
configFile = pkgs.replaceVars ./Caddyfile {
|
||||||
src = ./Caddyfile;
|
|
||||||
robots = toString ../tyo0/robots.txt;
|
robots = toString ../tyo0/robots.txt;
|
||||||
inherit (pkgs) mastodon;
|
inherit (pkgs) mastodon;
|
||||||
};
|
};
|
||||||
|
|
|
@ -67,9 +67,7 @@
|
||||||
|
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configFile = pkgs.substituteAll {
|
configFile = pkgs.replaceVars ./Caddyfile {
|
||||||
src = ./Caddyfile;
|
|
||||||
|
|
||||||
"element" = pkgs.element-web.override {
|
"element" = pkgs.element-web.override {
|
||||||
element-web-unwrapped = pkgs.element-web-unwrapped.overrideAttrs (oldAttrs: {
|
element-web-unwrapped = pkgs.element-web-unwrapped.overrideAttrs (oldAttrs: {
|
||||||
version = "1.11.74-rc.0";
|
version = "1.11.74-rc.0";
|
||||||
|
@ -93,8 +91,6 @@
|
||||||
homeserverList = ["ny4.dev"];
|
homeserverList = ["ny4.dev"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
"mastodon" = pkgs.mastodon;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -37,18 +37,7 @@
|
||||||
"clash/proxy-providers/spcloud" = {};
|
"clash/proxy-providers/spcloud" = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
# why not substituteAll? see https://github.com/NixOS/nixpkgs/issues/237216
|
sops.templates."clash.yaml".file = pkgs.replaceVars ./config.yaml {
|
||||||
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
|
inherit
|
||||||
(config.sops.placeholder)
|
(config.sops.placeholder)
|
||||||
"clash/secret"
|
"clash/secret"
|
||||||
|
|
Loading…
Reference in a new issue