Skip to content

Commit f6137cb

Browse files
committed
virtualisation: Make parallels handling more lazy
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.
1 parent 9f2a45b commit f6137cb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

modules/nixos/virtualisation.nix

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ in
9797

9898
# parallels
9999
hardware.parallels.enable = lib.mkIf cfg.parallels.enable (lib.mkDefault true);
100-
nixpkgs.config = lib.mkIf (!options.nixpkgs.pkgs.isDefined) {
101-
allowUnfreePredicate = lib.mkIf cfg.parallels.enable (
102-
pkg: builtins.elem (lib.getName pkg) [ "prl-tools" ]
103-
);
100+
nixpkgs.config = lib.mkIf (!options.nixpkgs.pkgs.isDefined && cfg.parallels.enable) {
101+
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "prl-tools" ];
104102
};
105103
};
106104
}

0 commit comments

Comments
 (0)