From 895a3b061bb4717955ffbceab3bf3c6ecebacd70 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 12 May 2024 22:34:23 +0200 Subject: build: switch to flakes --- nix/package.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 nix/package.nix (limited to 'nix/package.nix') diff --git a/nix/package.nix b/nix/package.nix new file mode 100644 index 0000000..6c942b0 --- /dev/null +++ b/nix/package.nix @@ -0,0 +1,37 @@ +{ 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 +, css +}: +buildGoApplication { + pname = "searchix"; + version = "0.1"; + src = with pkgs.lib.fileset; toSource { + root = ../.; + fileset = difference + (unions [ + ../go.mod + ../go.sum + ../serve + ../import + ../internal + ../frontend + ]) + (maybeMissing ../frontend/static/base.css); + }; + + patchPhase = '' + cp ${css} frontend/static/base.css + ''; + tags = [ "embed" ]; + modules = ../gomod2nix.toml; +} -- cgit 1.4.1