summary refs log tree commit diff stats
path: root/pkgs/by-name/ba
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-24 01:21:01 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-24 01:21:01 +0100
commit76164d42395a716d4116fa43138307ac00b4b20e (patch)
tree48eeb66b5d3baa0ad24fc7d6cba5fa472823d62b /pkgs/by-name/ba
parentdocs(pkgs/back): Add note about needed write access (diff)
downloadnixos-server-76164d42395a716d4116fa43138307ac00b4b20e.tar.gz
nixos-server-76164d42395a716d4116fa43138307ac00b4b20e.zip
build(pkgs/back): Apply source filtering
This avoids useless rebuilds, just because files like the `README.md`
changed.
Diffstat (limited to 'pkgs/by-name/ba')
-rw-r--r--pkgs/by-name/ba/back/package.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/by-name/ba/back/package.nix b/pkgs/by-name/ba/back/package.nix
index dbc00cb..faa0e1d 100644
--- a/pkgs/by-name/ba/back/package.nix
+++ b/pkgs/by-name/ba/back/package.nix
@@ -8,12 +8,21 @@
 #
 # You should have received a copy of the License along with this program.
 # If not, see <https://www.gnu.org/licenses/agpl.txt>.
-{rustPlatform}:
+{
+  rustPlatform,
+  lib,
+}:
 rustPlatform.buildRustPackage {
   pname = "back";
   version = "1.0.0";
 
-  src = ./.;
+  src = lib.cleanSourceWith {
+    src = lib.cleanSource ./.;
+    filter = name: type:
+      (type == "directory")
+      || (builtins.elem (builtins.baseNameOf name) ["Cargo.toml" "Cargo.lock" "style.css"])
+      || (lib.strings.hasSuffix ".rs" (builtins.baseNameOf name));
+  };
 
   doCheck = true;