Created
October 7, 2025 02:15
-
-
Save BohdanTkachenko/6ba2730ff54ecbb2d7aed22dec3507d5 to your computer and use it in GitHub Desktop.
Nix Home Manager systemd user environment generator for session variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { config, pkgs, ... }: | |
| let | |
| nixPkg = if config.nix.package == null then pkgs.nix else config.nix.package; | |
| profileDirectory = config.home.profileDirectory; | |
| in | |
| { | |
| # TODO: remove when/if https://github.com/nix-community/home-manager/pull/7949 is merged. | |
| xdg.configFile."systemd/user-environment-generators/05-home-manager.sh" = { | |
| text = '' | |
| . "${nixPkg}/etc/profile.d/nix.sh" | |
| . "${profileDirectory}/etc/profile.d/hm-session-vars.sh" | |
| ''; | |
| executable = true; | |
| force = true; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment