fix(package): use filesets so nixtest doesnt get rebuilt all the time

This commit is contained in:
technofab 2025-06-02 01:13:05 +02:00
parent 0b783157bb
commit 25de5061ad

View file

@ -1,15 +1,21 @@
{buildGoModule, ...}:
{
lib,
buildGoModule,
...
}:
buildGoModule {
name = "nixtest";
src =
# filter everything except for cmd/ and go.mod, go.sum
builtins.filterSource (
path: type:
builtins.match ".*(/cmd/?.*|/go\.(mod|sum))$"
path
!= null
)
./.;
with lib.fileset;
toSource {
root = ./.;
fileset = unions [
./cmd
./go.mod
./go.sum
];
};
subPackages = ["cmd/nixtest"];
vendorHash = "sha256-Hmdtkp3UK/lveE2/U6FmKno38DxY+MMQlQuZFf1UBME=";
meta.mainProgram = "nixtest";