-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
programs.screen's assertion doesn't run, possibly due to confusing semantics around mkIf? #312194
Comments
Oh, I think I see what's going on.
This assertion just won't work. There's presumably a way to do this in https://github.com/NixOS/nixpkgs/blob/master/lib/modules.nix that does the right thing. |
I found a way, but it's gross. Disclaimer: I've never explored the innards of options/module merging, so my understanding/terminology is going to be way off. The idea is to lift the plain attrset into the NixOS module value space (?) via config = lib.mkMerge [
(lib.mkIf true { assertions = foo; })
(lib.mkIf cfg.enable { blah = 2; })
]; It works! |
See NixOS#312194 (comment) for explanation why the assertion currently fails to run.
See NixOS#312194 (comment) for explanation why the assertion currently fails to run.
See #312194 (comment) for explanation why the assertion currently fails to run.
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
This should fail to build, due to this assertion:
nixpkgs/nixos/modules/programs/screen.nix
Lines 27 to 32 in 005028d
But the assertion doesn't assert.
As a means of diagnosis, if I remove "lib.mkIf cfg.enable" from line 33, the assertion asserts.
Very confusing!
Additional context
I noticed this oddity between lib.mkIf,
//
, and assertions, while addressing a PR review comment in an unrelated PR: #312187 (comment)Notify maintainers
@vrthra
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: