So I have this in terraform.nix
let
terraformOverlay = final: prev: {
terraformCustom = final.terraform_0_14.withPlugins
(p: [ p.aws p.helm p.kubernetes p.local p.null p.random p.template ]);
terraform_0_14 = prev.terraform_0_14.overrideAttrs (old: rec {
name = "terraform-${version}";
version = "0.14.4";
src = prev.fetchFromGitHub {
owner = "hashicorp";
repo = "terraform";
rev = "v${version}";
sha256 = "0kjbx1gshp1lvhnjfigfzza0sbl3m6d9qb3in7q5vc6kdkiplb66";
};
});
};
in import <nixpkgs> { overlays = [ terraformOverlay ]; }
default.nix
:
self: super:
{
terraform-custom = self.callPackage ./terraform.nix { };
}
and in configuration.nix
I have:
nixpkgs.overlays = [ (import ./overlays/default.nix) ];
locally I was able to build package with:
nix-build terraform.nix -A terraformCustom
under section:
environment.systemPackages = with pkgs; [
];
I’ve tried to use terraform-custom
or terraformCustom
from the overlays itself, but apparently I don’t understand how that works.
dir structure:
├── configuration.nix
├── hardware-configuration.nix
├── modules
│ ├── dwm.nix
│ ├── environment.nix
│ ├── gnome.nix
│ ├── hardware.nix
│ ├── i3.nix
│ ├── packages.nix
│ ├── programs.nix
│ ├── services.nix
│ ├── syncthing.nix
│ └── xserver.nix
└── overlays
├── default.nix
├── result -> /nix/store/jz8sl4h3mv9939sn7ja6s1b0a1jhq6wa-terraform-0.14.4
└── terraform.nix
currently nixos-rebuild switch works fine, but I don’t see terraform in PATH, probably it does not invoke overlay properly.
what’s the better way to integrate that into configuration.nix
?