mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
parent
41101d0e62
commit
ddeeb031fd
2 changed files with 25 additions and 9 deletions
|
@ -373,6 +373,16 @@ in
|
|||
description = "The package containing the complete activation script.";
|
||||
};
|
||||
|
||||
home.extraActivationPath = mkOption {
|
||||
internal = true;
|
||||
type = types.listOf types.package;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra packages to add to <envar>PATH</envar> within the activation
|
||||
script.
|
||||
'';
|
||||
};
|
||||
|
||||
home.extraBuilderCommands = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
|
@ -570,15 +580,17 @@ in
|
|||
|
||||
# Programs that always should be available on the activation
|
||||
# script's PATH.
|
||||
activationBinPaths = lib.makeBinPath [
|
||||
pkgs.bash
|
||||
pkgs.coreutils
|
||||
pkgs.diffutils # For `cmp` and `diff`.
|
||||
pkgs.findutils
|
||||
pkgs.gnugrep
|
||||
pkgs.gnused
|
||||
pkgs.ncurses # For `tput`.
|
||||
]
|
||||
activationBinPaths = lib.makeBinPath (
|
||||
[
|
||||
pkgs.bash
|
||||
pkgs.coreutils
|
||||
pkgs.diffutils # For `cmp` and `diff`.
|
||||
pkgs.findutils
|
||||
pkgs.gnugrep
|
||||
pkgs.gnused
|
||||
pkgs.ncurses # For `tput`.
|
||||
] ++ config.home.extraActivationPath
|
||||
)
|
||||
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
|
||||
|
||||
activationScript = pkgs.writeShellScript "activation-script" ''
|
||||
|
|
|
@ -32,6 +32,10 @@ let
|
|||
|
||||
home.username = config.users.users.${name}.name;
|
||||
home.homeDirectory = config.users.users.${name}.home;
|
||||
|
||||
# Make activation script use same version of Nix as system as a whole.
|
||||
# This avoids problems with Nix not being in PATH.
|
||||
home.extraActivationPath = [ config.nix.package ];
|
||||
};
|
||||
})
|
||||
] ++ cfg.sharedModules;
|
||||
|
|
Loading…
Reference in a new issue