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

virtualisation: Make parallels handling more lazy #48

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

britter
Copy link
Contributor

@britter britter commented Oct 27, 2024

Moves the condition to allow parallels as an unfree module up one level.
This is required for users who don't instantiate their own nixpkgs
instance which causes options.nixpkgs.pkgs.isDefined being false.
In this case, although cfg.parallels.enable is false, the
allowUnfreePredicate will still be set resulting an error complaining
about allowUnfreePredicate option being used but not defined.

Moves the condition to allow parallels as an unfree module up one level.
This is required for users who don't instantiate their own nixpkgs
instance which causes `options.nixpkgs.pkgs.isDefined` being false.
In this case, although `cfg.parallels.enable` is false, the
`allowUnfreePredicate` will still be set resulting an error complaining
about `allowUnfreePredicate` option being used but not defined.
@britter
Copy link
Contributor Author

britter commented Oct 27, 2024

Tried this on my configuration with a local checkout of this repository. Without this change, rebuilding my configuration will fail with

building the system configuration...
warning: Git tree '/home/bene/github/britter/nix-configuration' is dirty
error:
       … while calling the 'head' builtin

         at /nix/store/z7j461v8da67nwrad4xz50dx2l5wk0wz-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/z7j461v8da67nwrad4xz50dx2l5wk0wz-source/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `allowUnfreePredicate' is used but not defined.

After applying this fix to my local checkout, I can build my configuration again.

@brianmcgee brianmcgee merged commit 15b6531 into nix-community:main Oct 27, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants