blob: d3115051e0c65cec38989274e33a6968ffd3deaf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
{ 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
, self
, testers
}:
let
inherit (builtins) concatStringsSep match;
version = "0-unstable-" + concatStringsSep "-" (match
"([[:digit:]]{4})([[:digit:]]{2})([[:digit:]]{2}).*"
self.lastModifiedDate
);
in
buildGoApplication {
pname = "searchix";
inherit version;
src = with pkgs.lib.fileset; toSource {
root = ../.;
fileset = difference
(unions [
../go.mod
../go.sum
../searchix.go
../internal
../frontend
])
(maybeMissing ../frontend/static/base.css);
};
patchPhase = ''
rm -f frontend/static/base.css
cp ${css} frontend/static/base.css
'';
tags = [ "embed" ];
ldflags = [
"-s"
"-w"
"-X"
"searchix/internal/config.CommitSHA=${self.rev or self.dirtyRev}"
"-X"
"searchix/internal/config.ShortSHA=${self.shortRev or self.dirtyShortRev}"
"-X"
"main.buildVersion=${version}"
];
modules = ../gomod2nix.toml;
}
|