xsession: Add profilePath configuration option (#2140)
This allows the user to move .xprofile somewhere else, which can help with decluttering their home directory.
This commit is contained in:
parent
dc4337d9fe
commit
85d67b0a6e
|
@ -18,11 +18,21 @@ in {
|
|||
default = ".xsession";
|
||||
example = ".xsession-hm";
|
||||
description = ''
|
||||
Path, relative <envar>HOME</envar>, where Home Manager
|
||||
Path, relative to <envar>HOME</envar>, where Home Manager
|
||||
should write the X session script.
|
||||
'';
|
||||
};
|
||||
|
||||
profilePath = mkOption {
|
||||
type = types.str;
|
||||
default = ".xprofile";
|
||||
example = ".xprofile-hm";
|
||||
description = ''
|
||||
Path, relative to <envar>HOME</envar>, where Home Manager
|
||||
should write the X profile script.
|
||||
'';
|
||||
};
|
||||
|
||||
windowManager.command = mkOption {
|
||||
type = types.str;
|
||||
example = literalExample ''
|
||||
|
@ -129,7 +139,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
home.file.".xprofile".text = ''
|
||||
home.file.${cfg.profilePath}.text = ''
|
||||
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||
|
||||
if [ -e "$HOME/.profile" ]; then
|
||||
|
@ -154,7 +164,7 @@ in {
|
|||
executable = true;
|
||||
text = ''
|
||||
if [ -z "$HM_XPROFILE_SOURCED" ]; then
|
||||
. ~/.xprofile
|
||||
. "${config.home.homeDirectory}/${cfg.profilePath}"
|
||||
fi
|
||||
unset HM_XPROFILE_SOURCED
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
if [ -z "$HM_XPROFILE_SOURCED" ]; then
|
||||
. ~/.xprofile
|
||||
. "/home/hm-user/.xprofile"
|
||||
fi
|
||||
unset HM_XPROFILE_SOURCED
|
||||
|
||||
|
|
Loading…
Reference in a new issue