nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.83k stars 1.79k forks source link

A way to expand environment variables? #498

Closed seqizz closed 5 years ago

seqizz commented 5 years ago

Hi again,

I've installed krunner-pass package via home.packages, but krunner couldn't see this plugin because QT_PLUGIN_PATH variable is not including ~/.nix-profile/lib/qt-5.11/plugins.

Since I am installing the package in my user profile, I guess I need to make the adjustments here too. Tried with home.sessionVariables but couldn't manage to append to the variables. Do we have a recommended way that I've skipped?

Thanks

marsam commented 5 years ago

you need to escape the dollar-sign

    sessionVariables = {
      QT_PLUGIN_PATH = "~/.nix-profile/lib/qt-5.11/plugins:\${QT_PLUGIN_PATH}";
    };
seqizz commented 5 years ago

Ah thanks. Also after a bit digging I realized it doesn't put anything anywhere to source hm-session-vars.sh for zsh. I'll try to handle it on configuration.nix.

rycee commented 5 years ago

@seqizz If you don't want Home Manager to configure your zsh setup then you need to do step 4 in the installation instructions.

seqizz commented 5 years ago

Sadly this is not solving it. Yes it exports the variable correctly but I need this variable to be enabled before krunner starts so it can detect the plugins. I guess I have 2 options: Either moving all package installations under global configuration or starting plasma desktop via home-manager. Thanks for the suggestion anyway :+1:

seqizz commented 5 years ago

Ahh nevermind. The whole issue was caused by caches. Wiping out all kde/plasma related stuff under .cache folder and logout+login solved everything. Sorry for unnecessary noise.