Filter source in Nix build to prevent spurious rebuilds
This commit is contained in:
17
flake.lock
generated
17
flake.lock
generated
@@ -1,5 +1,21 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nix-filter": {
|
||||
"locked": {
|
||||
"lastModified": 1619956448,
|
||||
"narHash": "sha256-4OZjkK1vot9vdg+8jj9+hm4c6mSEc9/OJDQzNvLHBKE=",
|
||||
"owner": "numtide",
|
||||
"repo": "nix-filter",
|
||||
"rev": "cf06efe613a06f1505f187712a307c05b3901884",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"ref": "master",
|
||||
"repo": "nix-filter",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1618886496,
|
||||
@@ -18,6 +34,7 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nix-filter": "nix-filter",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
{
|
||||
|
||||
description = "Tinyquiz – an open source online quiz platform";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
inputs.nix-filter.url = "github:numtide/nix-filter/master";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
outputs = { self, nixpkgs, nix-filter }:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
buildCmd = name:
|
||||
(pkgs.buildGoPackage {
|
||||
pname = "tinyquiz-${name}";
|
||||
version = "dev";
|
||||
src = ./.;
|
||||
src = with nix-filter.lib; filter { root = ./.; include = [ (inDirectory "cmd") (inDirectory "pkg") (inDirectory "ui") "go.mod" "go.sum" ]; };
|
||||
goDeps = ./deps.nix;
|
||||
preBuild = "go generate vkane.cz/tinyquiz/...";
|
||||
checkPhase = "go test -race vkane.cz/tinyquiz/...";
|
||||
|
||||
Reference in New Issue
Block a user