mirror of
https://github.com/nix-community/home-manager
synced 2024-12-01 07:29:46 +01:00
home.activationPackageSet -> _module.args.activationPkgs
This commit is contained in:
parent
035d5caf09
commit
fb61dd9ea2
6 changed files with 40 additions and 49 deletions
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{ pkgs, activationPkgs, config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
|
@ -79,7 +79,7 @@ in
|
|||
(mapAttrsToList (n: v: v.target)
|
||||
(filterAttrs (n: v: v.force) cfg));
|
||||
|
||||
check = config.home.activationPackageSet.writeText "check" ''
|
||||
check = activationPkgs.writeText "check" ''
|
||||
${config.lib.bash.initHomeManagerLib}
|
||||
|
||||
# A symbolic link whose target path matches this pattern will be
|
||||
|
@ -168,7 +168,7 @@ in
|
|||
# source and target generation.
|
||||
home.activation.linkGeneration = hm.dag.entryAfter ["writeBoundary"] (
|
||||
let
|
||||
link = config.home.activationPackageSet.writeShellScript "link" ''
|
||||
link = activationPkgs.writeShellScript "link" ''
|
||||
${config.lib.bash.initHomeManagerLib}
|
||||
|
||||
newGenFiles="$1"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, activationPkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
|
@ -425,11 +425,6 @@ in
|
|||
description = "The package containing the complete activation script.";
|
||||
};
|
||||
|
||||
home.activationPackageSet = mkOption {
|
||||
type = with types; lazyAttrsOf anything;
|
||||
description = "The package set to be used to in the complete activation script.";
|
||||
};
|
||||
|
||||
home.extraActivationPath = mkOption {
|
||||
internal = true;
|
||||
type = types.listOf types.package;
|
||||
|
@ -654,7 +649,6 @@ in
|
|||
source ${../lib/bash/home-manager.sh}
|
||||
'';
|
||||
|
||||
home.activationPackageSet = lib.mkDefault pkgs;
|
||||
home.activationPackage =
|
||||
let
|
||||
mkCmd = res: ''
|
||||
|
@ -672,7 +666,7 @@ in
|
|||
# Programs that always should be available on the activation
|
||||
# script's PATH.
|
||||
activationBinPaths = lib.makeBinPath (
|
||||
with cfg.activationPackageSet; [
|
||||
with activationPkgs; [
|
||||
bash
|
||||
coreutils
|
||||
diffutils # For `cmp` and `diff`.
|
||||
|
@ -691,11 +685,11 @@ in
|
|||
if config.nix.enable && config.nix.package != null then
|
||||
":${config.nix.package}/bin"
|
||||
else
|
||||
":$(${cfg.activationPackageSet.coreutils}/bin/dirname $(${cfg.activationPackageSet.coreutils}/bin/readlink -m $(type -p nix-env)))"
|
||||
":$(${activationPkgs.coreutils}/bin/dirname $(${activationPkgs.coreutils}/bin/readlink -m $(type -p nix-env)))"
|
||||
)
|
||||
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
|
||||
|
||||
activationScript = cfg.activationPackageSet.writeShellScript "activation-script" ''
|
||||
activationScript = activationPkgs.writeShellScript "activation-script" ''
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, activationPkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
|
@ -85,22 +85,18 @@ in {
|
|||
'';
|
||||
|
||||
home.activation.dconfSettings = hm.dag.entryAfter [ "installPackages" ] (let
|
||||
iniFile = config.home.activationPackageSet.writeText "hm-dconf.ini"
|
||||
(toDconfIni cfg.settings);
|
||||
iniFile =
|
||||
activationPkgs.writeText "hm-dconf.ini" (toDconfIni cfg.settings);
|
||||
|
||||
statePath = "state/${stateDconfKeys.name}";
|
||||
|
||||
cleanup =
|
||||
config.home.activationPackageSet.writeShellScript "dconf-cleanup" ''
|
||||
cleanup = activationPkgs.writeShellScript "dconf-cleanup" ''
|
||||
set -euo pipefail
|
||||
|
||||
${config.lib.bash.initHomeManagerLib}
|
||||
|
||||
PATH=${
|
||||
makeBinPath [
|
||||
config.home.activationPackageSet.dconf
|
||||
config.home.activationPackageSet.jq
|
||||
]
|
||||
makeBinPath [ activationPkgs.dconf activationPkgs.jq ]
|
||||
}''${PATH:+:}$PATH
|
||||
|
||||
oldState="$1"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, activationPkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
|
@ -106,7 +106,7 @@ in {
|
|||
home.activation.xfconfSettings = hm.dag.entryAfter [ "installPackages" ]
|
||||
(let
|
||||
mkCommand = channel: property: value: ''
|
||||
run ${cfg.activationPackageSet.xfce.xfconf}/bin/xfconf-query \
|
||||
run ${activationPkgs.xfce.xfconf}/bin/xfconf-query \
|
||||
${
|
||||
escapeShellArgs ([ "-c" channel "-p" "/${property}" ]
|
||||
++ (if value == null then
|
||||
|
@ -120,13 +120,13 @@ in {
|
|||
(channel: properties: mapAttrsToList (mkCommand channel) properties)
|
||||
cfg.settings;
|
||||
|
||||
load = cfg.activationPackageSet.writeShellScript "load-xfconf"
|
||||
load = activationPkgs.writeShellScript "load-xfconf"
|
||||
(concatMapStrings concatStrings commands);
|
||||
in ''
|
||||
if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
|
||||
export DBUS_RUN_SESSION_CMD=""
|
||||
else
|
||||
export DBUS_RUN_SESSION_CMD="${cfg.activationPackageSet.dbus}/bin/dbus-run-session --dbus-daemon=${pkgs.dbus}/bin/dbus-daemon"
|
||||
export DBUS_RUN_SESSION_CMD="${activationPkgs.dbus}/bin/dbus-run-session --dbus-daemon=${pkgs.dbus}/bin/dbus-daemon"
|
||||
fi
|
||||
|
||||
run $DBUS_RUN_SESSION_CMD ${load}
|
||||
|
|
|
@ -395,6 +395,7 @@ let
|
|||
else
|
||||
<nixpkgs>);
|
||||
_module.args.pkgs = lib.mkDefault pkgs;
|
||||
_module.args.activationPkgs = lib.mkDefault pkgs;
|
||||
_module.check = check;
|
||||
lib = lib.hm;
|
||||
} // optionalAttrs useNixpkgsModule {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, activationPkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
|
@ -314,7 +314,7 @@ in {
|
|||
'';
|
||||
legacy = ''
|
||||
PATH=${dirOf cfg.systemctlPath}:$PATH \
|
||||
${cfg.activationPackageSet.ruby}/bin/ruby ${./systemd-activate.rb} \
|
||||
${activationPkgs.ruby}/bin/ruby ${./systemd-activate.rb} \
|
||||
"''${oldGenPath=}" "$newGenPath" "${servicesStartTimeoutMs}"
|
||||
'';
|
||||
sd-switch = let
|
||||
|
|
Loading…
Reference in a new issue