Skip to content

nixos/displayManager: add XDG_SESSION_ID to systemd user environment #93764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2020

Conversation

evenbrenden
Copy link
Contributor

@evenbrenden evenbrenden commented Jul 24, 2020

This is a revamp of @misuzu's #67751, with SLiM changes omitted and xss-lock changes added.

Motivation for this change

xss-lock needs XDG_SESSION_ID to respond to loginctl lock-session (and possibly other session operations such as idle hint management). Tested with LightDM.

Things done

Add XDG_SESSION_ID to the list of imported environment variables when starting systemctl.

Inspired by home-manager, add importVariables configuration.

Set session to XDG_SESSION_ID when running xss-lock as a service.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@evenbrenden evenbrenden force-pushed the xdg-session-id-user-units branch 2 times, most recently from 9b3ab47 to 235dc5c Compare July 24, 2020 12:13
@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jul 24, 2020
@jtojnar jtojnar requested a review from flokli July 24, 2020 21:14
@evenbrenden evenbrenden force-pushed the xdg-session-id-user-units branch from 235dc5c to 58773b3 Compare July 25, 2020 05:43
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/254

@evenbrenden
Copy link
Contributor Author

@flokli @hedning Do you have a moment to take a look at this?

Adding the importVariables option is sufficient for the use case, so if mixing in xss-lock and/or always setting XDG_SESSION_ID is too much, I could split this up.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
xss-lock needs XDG_SESSION_ID to respond to loginctl lock-session(s)
(and possibly other session operations such as idle hint management).
This change adds XDG_SESSION_ID to the list of imported environment
variables when starting systemctl.

Inspired by home-manager, add importVariables configuration.

Set session to XDG_SESSION_ID when running xss-lock as a service.

Co-authored-by: misuzu <bakalolka@gmail.com>
@evenbrenden evenbrenden force-pushed the xdg-session-id-user-units branch from 58773b3 to 660882d Compare September 5, 2020 18:36
@worldofpeace
Copy link
Contributor

@ofborg eval

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-config-hybrid-sleep-after-idle-and-lock/8728/12

Copy link
Contributor

@hedning hedning left a comment

Choose a reason for hiding this comment

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

LGTM. importedVariables is a nice improvement :)

@evenbrenden
Copy link
Contributor Author

As far as I understand, the grahamcofborg-eval-nixpkgs-unstable-jobset failure was #97170, which is closed and unrelated. @worldofpeace does it make sense to trigger another eval?

@worldofpeace
Copy link
Contributor

@ofborg eval

@worldofpeace
Copy link
Contributor

Yep

@worldofpeace worldofpeace merged commit e044909 into NixOS:master Sep 9, 2020
@evenbrenden evenbrenden deleted the xdg-session-id-user-units branch September 9, 2020 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants