summary refs log tree commit diff
path: root/nix/checks.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-02-22 12:44:00 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-22 12:50:02 +0000
commit01498855f84ee87d66e6295efcaf7a32d67f4dad (patch)
tree25c5f3e1f17d5e23094b7a132e56e390c930dd20 /nix/checks.nix
parent8dc2fa52cae39fae0af9ac0738b7a2fade83d4ec (diff)
downloadspectrum-01498855f84ee87d66e6295efcaf7a32d67f4dad.tar
spectrum-01498855f84ee87d66e6295efcaf7a32d67f4dad.tar.gz
spectrum-01498855f84ee87d66e6295efcaf7a32d67f4dad.tar.bz2
spectrum-01498855f84ee87d66e6295efcaf7a32d67f4dad.tar.lz
spectrum-01498855f84ee87d66e6295efcaf7a32d67f4dad.tar.xz
spectrum-01498855f84ee87d66e6295efcaf7a32d67f4dad.tar.zst
spectrum-01498855f84ee87d66e6295efcaf7a32d67f4dad.zip
nix: centralise source cleaning
This was getting very repetitive.  Having a single copy of the sources
shared between builds will also save on store space, and means we
don't need to support overriding the path to the scripts directory in
Makefiles.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'nix/checks.nix')
-rw-r--r--nix/checks.nix16
1 files changed, 2 insertions, 14 deletions
diff --git a/nix/checks.nix b/nix/checks.nix
index bbaf78a..555ad8d 100644
--- a/nix/checks.nix
+++ b/nix/checks.nix
@@ -23,13 +23,7 @@
   rustfmt = config.pkgs.callPackage (
     { lib, runCommand, rustfmt }:
     runCommand "spectrum-rustfmt" {
-      src = lib.cleanSourceWith {
-        filter = path: type:
-          (builtins.baseNameOf path != "build" && type == "directory")
-          || builtins.match ''.*[^/]\.rs'' path != null;
-        src = lib.cleanSource ../.;
-      };
-
+      inherit (config) src;
       nativeBuildInputs = [ rustfmt ];
     } ''
       shopt -s globstar
@@ -41,13 +35,7 @@
   shellcheck = config.pkgs.callPackage (
     { lib, runCommand, shellcheck }:
     runCommand "spectrum-shellcheck" {
-      src = lib.cleanSourceWith {
-        filter = path: type:
-          (builtins.baseNameOf path != "build" && type == "directory")
-          || builtins.match ''.*[^/]\.sh'' path != null;
-        src = lib.cleanSource ../.;
-      };
-
+      inherit (config) src;
       nativeBuildInputs = [ shellcheck ];
     } ''
       shopt -s globstar