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": {
|
"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": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1618886496,
|
"lastModified": 1618886496,
|
||||||
@@ -18,6 +34,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"nix-filter": "nix-filter",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
description = "Tinyquiz – an open source online quiz platform";
|
description = "Tinyquiz – an open source online quiz platform";
|
||||||
|
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
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
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
buildCmd = name:
|
buildCmd = name:
|
||||||
(pkgs.buildGoPackage {
|
(pkgs.buildGoPackage {
|
||||||
pname = "tinyquiz-${name}";
|
pname = "tinyquiz-${name}";
|
||||||
version = "dev";
|
version = "dev";
|
||||||
src = ./.;
|
src = with nix-filter.lib; filter { root = ./.; include = [ (inDirectory "cmd") (inDirectory "pkg") (inDirectory "ui") "go.mod" "go.sum" ]; };
|
||||||
goDeps = ./deps.nix;
|
goDeps = ./deps.nix;
|
||||||
preBuild = "go generate vkane.cz/tinyquiz/...";
|
preBuild = "go generate vkane.cz/tinyquiz/...";
|
||||||
checkPhase = "go test -race vkane.cz/tinyquiz/...";
|
checkPhase = "go test -race vkane.cz/tinyquiz/...";
|
||||||
|
|||||||
Reference in New Issue
Block a user