Skip to content

Commit

Permalink
Filter source in Nix build to prevent spurious rebuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
vojta001 committed May 4, 2021
1 parent f1ca80c commit 51c559b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -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/...";
Expand Down

0 comments on commit 51c559b

Please sign in to comment.