mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
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
2 changed files with 14 additions and 4 deletions
|
@ -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