all repos — homestead @ d19513a851f9a9a19bd8d6278cead1b461c2c3e3

Code for my website

add nix package for builder

Alan Pearce
commit

d19513a851f9a9a19bd8d6278cead1b461c2c3e3

parent

667cddc4df71aa7496527bb659b2d41fafceb91e

1 file changed, 32 insertions(+), 0 deletions(-)

changed files
A cmd/build/default.nix
@@ -0,0 +1,32 @@
+{ pkgs ? ( + let + inherit (builtins) fetchTree fromJSON readFile; + inherit ((fromJSON (readFile ../../flake.lock)).nodes) nixpkgs gomod2nix; + in + import (fetchTree nixpkgs.locked) { + overlays = [ + (import "${fetchTree gomod2nix.locked}/overlay.nix") + ]; + } + ) +, buildGoApplication ? pkgs.buildGoApplication +, templ ? pkgs.templ +, makeWrapper ? pkgs.makeWrapper +}: + +buildGoApplication { + pname = "build"; + version = "0.1"; + pwd = ../..; + src = ../..; + modules = ./gomod2nix.toml; + patchPhase = '' + ${templ}/bin/templ generate + ''; + subPackages = [ "cmd/build" ]; + nativeBuildInputs = [ makeWrapper ]; + + postInstall = '' + wrapProgram $out/bin/build --set KO_DATA_PATH ${../../templates} + ''; +}