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 = {
|
||||
enable = true;
|
||||
configFile = pkgs.substituteAll {
|
||||
src = ./Caddyfile;
|
||||
configFile = pkgs.replaceVars ./Caddyfile {
|
||||
robots = toString ../tyo0/robots.txt;
|
||||
inherit (pkgs) mastodon;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -37,18 +37,7 @@
|
|||
"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;
|
||||
sops.templates."clash.yaml".file = pkgs.replaceVars ./config.yaml {
|
||||
inherit
|
||||
(config.sops.placeholder)
|
||||
"clash/secret"
|
||||
|
|
Loading…
Reference in a new issue