fix nixos activation notify-send
This commit is contained in:
@@ -268,6 +268,10 @@ let
|
|||||||
lib.concatStringsSep "\n" env + "\n";
|
lib.concatStringsSep "\n" env + "\n";
|
||||||
fs.".profile".symlink.text = lib.mkMerge [
|
fs.".profile".symlink.text = lib.mkMerge [
|
||||||
(lib.mkBefore ''
|
(lib.mkBefore ''
|
||||||
|
# N.B.: this file must be valid in all plausible shells.
|
||||||
|
# it's primarily sourced by the user shell,
|
||||||
|
# but it may actually be sourced by bash, and even by other users (notably root).
|
||||||
|
#
|
||||||
# sessionCommands: ordered sequence of functions which will be called whenever this file is sourced.
|
# sessionCommands: ordered sequence of functions which will be called whenever this file is sourced.
|
||||||
# primarySessionCommands: additional functions which will be called only for the main session (i.e. login through GUI).
|
# primarySessionCommands: additional functions which will be called only for the main session (i.e. login through GUI).
|
||||||
# GUIs are expected to install a function to `primarySessionChecks` which returns true
|
# GUIs are expected to install a function to `primarySessionChecks` which returns true
|
||||||
@@ -326,7 +330,9 @@ let
|
|||||||
# sessionCommands+=('setXdgSessionType')
|
# sessionCommands+=('setXdgSessionType')
|
||||||
sourceEnv() {
|
sourceEnv() {
|
||||||
# source env vars and the like, as systemd would. `man environment.d`
|
# source env vars and the like, as systemd would. `man environment.d`
|
||||||
for env in ~/.config/environment.d/*.conf; do
|
# XXX: can't use `~` or `$HOME` here as they might not be set
|
||||||
|
local home=${lib.escapeShellArg config.home}
|
||||||
|
for env in "$home"/.config/environment.d/*.conf; do
|
||||||
# surround with `set -o allexport` since environment.d doesn't explicitly `export` their vars
|
# surround with `set -o allexport` since environment.d doesn't explicitly `export` their vars
|
||||||
set -a
|
set -a
|
||||||
source "$env"
|
source "$env"
|
||||||
@@ -334,12 +340,21 @@ let
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
sessionCommands+=('sourceEnv')
|
sessionCommands+=('sourceEnv')
|
||||||
|
ensurePath() {
|
||||||
|
# later sessionCommands might expect to run user-specific binaries,
|
||||||
|
# so make sure those are on PATH
|
||||||
|
local userBin=/etc/profiles/per-user/$USER/bin
|
||||||
|
if [[ ":$PATH:" != *":$userBin:"* ]]; then
|
||||||
|
export PATH="$PATH:$userBin"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
sessionCommands+=('ensurePath')
|
||||||
|
|
||||||
'')
|
'')
|
||||||
(lib.mkAfter ''
|
(lib.mkAfter ''
|
||||||
sessionCommands+=('maybeInitPrimarySession')
|
sessionCommands+=('maybeInitPrimarySession')
|
||||||
|
|
||||||
if (( ''${+PROFILE} )); then
|
if [ -n "''${PROFILE+profile_is_set}" ]; then
|
||||||
# allow the user to override the profile or disable it completely.
|
# allow the user to override the profile or disable it completely.
|
||||||
if [ -x "$PROFILE" ]; then
|
if [ -x "$PROFILE" ]; then
|
||||||
source "$PROFILE"
|
source "$PROFILE"
|
||||||
|
Reference in New Issue
Block a user