Skip to content

Instantly share code, notes, and snippets.

@stigtsp
Created May 13, 2020 09:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stigtsp/a5eda4b08d07298243d2b4e1b5b643b9 to your computer and use it in GitHub Desktop.
Save stigtsp/a5eda4b08d07298243d2b4e1b5b643b9 to your computer and use it in GitHub Desktop.
nix overlay example
# .config/nixpkgs/overlays/default.nix
self: super:
let
callPackage = super.lib.callPackageWith super;
in
{
packer = super.callPackage ./pkgs/packer {};
}
# .config/nixpkgs/overlays/pkgs/packer/default.nix
{ stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
name = "packer-${version}";
version = "1.3.5";
goPackagePath = "github.com/hashicorp/packer";
subPackages = [ "." ];
src = fetchFromGitHub {
owner = "hashicorp";
repo = "packer";
rev = "v${version}";
sha256 = "08anrc95nd5j4x4gia9rw151bdb99z72zgjdj8h0h9da177lqhbz";
};
meta = with stdenv.lib; {
description = "A tool for creating identical machine images for multiple platforms from a single source configuration";
homepage = https://www.packer.io;
license = licenses.mpl20;
platforms = platforms.unix;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment