From 0530612b78fc7d1d646e712ce06eebff75ee7768 Mon Sep 17 00:00:00 2001 From: 778a69cd <778a69cd@potsda.mn> Date: Thu, 23 Nov 2023 19:32:46 +0100 Subject: [PATCH] even stricter source directory filtering for better caching --- flake.nix | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 2a70ad98b..b5929a5ee 100644 --- a/flake.nix +++ b/flake.nix @@ -24,17 +24,31 @@ packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; + # Directories that are neither needed for building the frontend nor the backend. + # For better build caching. + unrelatedDirs = [ + "flake.lock" + (filter.matchExt "nix") + "docs" + "docker" + "docker-compose.test.yml" + "docker-compose.yml" + "generate-test-data" + ]; in { mobilizon = pkgs.callPackage ./. { src = filter { root = ./.; exclude = [ - "flake.lock" - (filter.matchExt "nix") "src" (filter.matchExt "js") - ]; + (filter.matchExt "ts") + (filter.matchExt "json") + "tests" + "scripts" + "public" + ] ++ unrelatedDirs; }; src-config = ./config; mobilizon-js = self.packages."${system}".mobilizon-frontend; @@ -50,11 +64,12 @@ (filter { root = ./.; exclude = [ - "flake.lock" - (filter.matchExt "nix") "lib" "config" - ]; + "test" + "rel" + "support" + ] ++ unrelatedDirs; }) { inherit nodejs;