Skip to content

xdg: add XDG_*_HOME variables to systemd.user.sessionVariables#2790

Merged
berbiche merged 1 commit intonix-community:masterfrom
ncfavier:xdg-vars-systemd
Mar 18, 2022
Merged

xdg: add XDG_*_HOME variables to systemd.user.sessionVariables#2790
berbiche merged 1 commit intonix-community:masterfrom
ncfavier:xdg-vars-systemd

Conversation

@ncfavier
Copy link
Copy Markdown
Member

Make sure those variables are set in systemd user services. This mirrors the situation for XDG_*_DIRS variables.

cc @tadfisher #1797

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

@ncfavier ncfavier requested a review from rycee as a code owner March 13, 2022 19:13
Comment thread modules/misc/xdg.nix Outdated
xdg.stateHome = mkDefault defaultStateHome;

home.sessionVariables = variables;
systemd.user.sessionVariables = mkIf pkgs.stdenv.isLinux variables;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
systemd.user.sessionVariables = mkIf pkgs.stdenv.isLinux variables;
systemd.user.sessionVariables = mkIf pkgs.stdenv.hostPlatform.isLinux variables;

Isn't stdenv.isLinux an alias for stdenv.hostPlatform.isLinux?

IIRC there was a PR in HM that changed the former expression to the latter.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied what I saw in modules/systemd.nix. Grepping for isLinux it seems about 50/50. I can't find that PR, I'd be curious what the motivation is; is the alias discouraged?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you're thinking of #2528 ? Or #2419 ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it for this file.

Make sure those variables are set in systemd user services.
This mirrors the situation for `XDG_*_DIRS` variables.
@sumnerevans sumnerevans requested a review from berbiche March 15, 2022 15:32
Copy link
Copy Markdown
Member

@berbiche berbiche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@berbiche berbiche merged commit a4b0a3f into nix-community:master Mar 18, 2022
@ncfavier ncfavier deleted the xdg-vars-systemd branch March 18, 2022 02:23
jficz pushed a commit to jficz/home-manager that referenced this pull request Apr 7, 2022
…ix-community#2790)

Make sure those variables are set in systemd user services.
This mirrors the situation for `XDG_*_DIRS` variables.
teto pushed a commit to teto/home-manager that referenced this pull request Aug 22, 2022
…ix-community#2790)

Make sure those variables are set in systemd user services.
This mirrors the situation for `XDG_*_DIRS` variables.
@teto teto mentioned this pull request Aug 22, 2022
7 tasks
spacekookie pushed a commit to spacekookie/home-manager that referenced this pull request Feb 10, 2023
…ix-community#2790)

Make sure those variables are set in systemd user services.
This mirrors the situation for `XDG_*_DIRS` variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants