Skip to content
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

nixos/shells-environment: make environment.variables lazy #79289

wants to merge 1 commit into from


Copy link

@edef1c edef1c commented Feb 5, 2020

Motivation for this change

This allows depending on config.environment.variables.* values without causing infinite recursion.

Things done
Copy link

@Infinisil Infinisil commented Feb 5, 2020

Unfortunately lazyAttrsOf isn't a panacea against strictness. I described this in the docs, namely that it doesn't work 100% with mkIf false-style definitions, which is also apparent from ofborg's error, because it leads to

environment.variables = {
GTK_USE_PORTAL = mkIf cfg.gtkUsePortal "1";

This is why lazyAttrsOf should only be used where either mkIf style definitions can't be used anyways (which is seldom the case, but an example is the one use introduced in #70138), or by making sure an unset value is somehow later processed/filtered, which is what I'm doing in #75584

Copy link
Member Author

@edef1c edef1c commented Feb 5, 2020

ACK. I figured I'd throw it at ofborg and see if it'd stick, since it had been working fine on my local machine so far.

@edef1c edef1c closed this Feb 5, 2020
@edef1c edef1c deleted the edef1c:lazy-env-vars branch Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.