mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-17 22:41:11 +01:00
treewide: substituteAll -> replaceVars/substitute
substituteAll is now officially deprecated.
This commit is contained in:
parent
d31710fb2c
commit
abfad3d295
12 changed files with 56 additions and 43 deletions
|
|
@ -101,9 +101,7 @@ in
|
|||
|
||||
storeDir = lib.escapeShellArg builtins.storeDir;
|
||||
|
||||
check = pkgs.substituteAll {
|
||||
src = ./files/check-link-targets.sh;
|
||||
|
||||
check = pkgs.replaceVars ./files/check-link-targets.sh {
|
||||
inherit (config.lib.bash) initHomeManagerLib;
|
||||
inherit forcedPaths storeDir;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,17 +8,16 @@
|
|||
}:
|
||||
let
|
||||
cfg = config.programs.command-not-found;
|
||||
commandNotFound = pkgs.substituteAll {
|
||||
name = "command-not-found";
|
||||
dir = "bin";
|
||||
src = ./command-not-found.pl;
|
||||
isExecutable = true;
|
||||
cnfScript = pkgs.replaceVars ./command-not-found.pl {
|
||||
inherit (cfg) dbPath;
|
||||
perl = pkgs.perl.withPackages (p: [
|
||||
p.DBDSQLite
|
||||
p.StringShellQuote
|
||||
]);
|
||||
};
|
||||
commandNotFound = pkgs.runCommand "command-not-found" { } ''
|
||||
install -Dm555 ${cnfScript} $out/bin/command-not-found
|
||||
'';
|
||||
|
||||
shInit = commandNotFoundHandlerName: ''
|
||||
# This function is called whenever a command is not found.
|
||||
|
|
|
|||
|
|
@ -14,9 +14,13 @@ let
|
|||
|
||||
withName =
|
||||
path:
|
||||
pkgs.substituteAll {
|
||||
pkgs.substitute {
|
||||
src = path;
|
||||
name = cfg.wrappedPackageName;
|
||||
substitutions = [
|
||||
"--replace"
|
||||
"@name@"
|
||||
cfg.wrappedPackageName
|
||||
];
|
||||
};
|
||||
|
||||
in
|
||||
|
|
|
|||
|
|
@ -11,12 +11,16 @@ let
|
|||
|
||||
substituteExpected =
|
||||
path:
|
||||
pkgs.substituteAll {
|
||||
pkgs.substitute {
|
||||
src = path;
|
||||
git_include_path = pkgs.writeText "hm_gitconfig" (builtins.readFile ./git-expected-include.conf);
|
||||
git_named_include_path = pkgs.writeText "hm_gitconfigwork" (
|
||||
builtins.readFile ./git-expected-include.conf
|
||||
);
|
||||
substitutions = [
|
||||
"--replace"
|
||||
"@git_include_path@"
|
||||
(pkgs.writeText "hm_gitconfig" (builtins.readFile ./git-expected-include.conf))
|
||||
"--replace"
|
||||
"@git_named_include_path@"
|
||||
(pkgs.writeText "hm_gitconfigwork" (builtins.readFile ./git-expected-include.conf))
|
||||
];
|
||||
};
|
||||
|
||||
in
|
||||
|
|
|
|||
|
|
@ -1,15 +1,3 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
|
||||
substituteExpected =
|
||||
path:
|
||||
pkgs.substituteAll {
|
||||
src = path;
|
||||
|
||||
sensible_rtp = pkgs.tmuxPlugins.sensible.rtp;
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
config = {
|
||||
programs.tmux = {
|
||||
|
|
@ -19,8 +7,7 @@ in
|
|||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/tmux/tmux.conf
|
||||
assertFileContent home-files/.config/tmux/tmux.conf \
|
||||
${substituteExpected ./default-shell.conf}
|
||||
assertFileContent home-files/.config/tmux/tmux.conf ${./default-shell.conf}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,8 @@
|
|||
};
|
||||
|
||||
nmt.script = "source ${
|
||||
pkgs.substituteAll {
|
||||
pkgs.replaceVars ./emacs-default-editor.sh {
|
||||
inherit (pkgs) coreutils;
|
||||
src = ./emacs-default-editor.sh;
|
||||
}
|
||||
}";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,13 @@
|
|||
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/emacs.service \
|
||||
${pkgs.substituteAll {
|
||||
inherit (pkgs) runtimeShell;
|
||||
${pkgs.substitute {
|
||||
src = ./emacs-service-emacs.service;
|
||||
substitutions = [
|
||||
"--replace"
|
||||
"@runtimeShell@"
|
||||
pkgs.runtimeShell
|
||||
];
|
||||
}}
|
||||
|
||||
assertFileContent \
|
||||
|
|
|
|||
|
|
@ -30,9 +30,13 @@
|
|||
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/emacs.service \
|
||||
${pkgs.substituteAll {
|
||||
inherit (pkgs) runtimeShell;
|
||||
${pkgs.substitute {
|
||||
src = ./emacs-service-emacs-after-graphical-session-target.service;
|
||||
substitutions = [
|
||||
"--replace"
|
||||
"@runtimeShell@"
|
||||
pkgs.runtimeShell
|
||||
];
|
||||
}}
|
||||
|
||||
assertFileContent \
|
||||
|
|
|
|||
|
|
@ -30,9 +30,13 @@
|
|||
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/emacs.service \
|
||||
${pkgs.substituteAll {
|
||||
inherit (pkgs) runtimeShell;
|
||||
${pkgs.substitute {
|
||||
src = ./emacs-service-emacs.service;
|
||||
substitutions = [
|
||||
"--replace"
|
||||
"@runtimeShell@"
|
||||
pkgs.runtimeShell
|
||||
];
|
||||
}}
|
||||
|
||||
assertFileContent \
|
||||
|
|
|
|||
|
|
@ -35,9 +35,16 @@
|
|||
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/emacs.service \
|
||||
${pkgs.substituteAll {
|
||||
inherit (pkgs) runtimeShell coreutils;
|
||||
${pkgs.substitute {
|
||||
src = ./emacs-socket-27-emacs.service;
|
||||
substitutions = [
|
||||
"--replace"
|
||||
"@runtimeShell@"
|
||||
pkgs.runtimeShell
|
||||
"--replace"
|
||||
"@coreutils@"
|
||||
pkgs.coreutils
|
||||
];
|
||||
}}
|
||||
|
||||
assertFileContent \
|
||||
|
|
|
|||
|
|
@ -35,9 +35,13 @@
|
|||
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/emacs.service \
|
||||
${pkgs.substituteAll {
|
||||
inherit (pkgs) runtimeShell coreutils;
|
||||
${pkgs.substitute {
|
||||
src = ./emacs-socket-28-emacs.service;
|
||||
substitutions = [
|
||||
"--replace"
|
||||
"@runtimeShell@"
|
||||
pkgs.runtimeShell
|
||||
];
|
||||
}}
|
||||
|
||||
assertFileContent \
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ in
|
|||
assertFileExists $sxhkdrc
|
||||
|
||||
assertFileContent $sxhkdrc ${
|
||||
pkgs.substituteAll {
|
||||
src = ./sxhkdrc;
|
||||
pkgs.replaceVars ./sxhkdrc {
|
||||
inherit script;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue