Hey, I’m struggling to use allowUnfreePredicate
in conjunction with the nixpkgs-terraform
overlay, to more easily specify the used terraform version for my devshell.
The following works, and opens up a shell when I run nix develop
with terraform available:
outputs = {
self,
nixpkgs,
flake-utils,
nixpkgs-terraform,
}:
flake-utils.lib.eachDefaultSystem
(
system: let
lib = nixpkgs.lib;
pkgs = import nixpkgs {
inherit system;
config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"terraform"
];
};
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
terraform
];
};
}
);
While this does not work:
outputs = {
self,
nixpkgs,
flake-utils,
nixpkgs-terraform,
}:
flake-utils.lib.eachDefaultSystem
(
system: let
lib = nixpkgs.lib;
pkgs = import nixpkgs {
inherit system;
config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"terraform"
## does not work either
# "terraform-1.7.4"
];
overlays = [nixpkgs-terraform.overlays.default];
};
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
terraform-versions."1.7.4"
];
};
}
);
Am I missing something in the functionality of overlays and the resulting package with regards to the allowed unfree software?
The error I’m getting with the second version is the default unfree package warning (doesn’t change when I allow unfree packages generally):
error: Package ‘terraform-1.7.4’ in /nix/store/kh5mw1hsalj27ha1wfvksljxyaikcmyb-source/pkgs/applications/networking/cluster/terraform/default.nix:52 has an unfree license (‘bsl11’), refusing to evaluate.