aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <getchoo@tuta.io>2023-09-09 15:10:15 -0400
committerseth <getchoo@tuta.io>2023-09-09 15:25:41 -0400
commit10192c540b85999c9a5cd075d695d1a4298ff9e5 (patch)
tree96049becf8a26cc4efbb8d37af1fb22aadd73300
parent6aa821df9c5cb2cd79e03ddad043ab49acfdd5a3 (diff)
downloadPrismLauncher-10192c540b85999c9a5cd075d695d1a4298ff9e5.tar.gz
PrismLauncher-10192c540b85999c9a5cd075d695d1a4298ff9e5.tar.bz2
PrismLauncher-10192c540b85999c9a5cd075d695d1a4298ff9e5.zip
feat(nix): add source filtering
this - along with garnix - should mostly eliminate unneeded (re)builds Signed-off-by: seth <getchoo@tuta.io>
-rw-r--r--flake.lock16
-rw-r--r--flake.nix1
-rw-r--r--nix/distribution.nix18
3 files changed, 34 insertions, 1 deletions
diff --git a/flake.lock b/flake.lock
index b1486ea6..df6039cf 100644
--- a/flake.lock
+++ b/flake.lock
@@ -89,6 +89,21 @@
"type": "github"
}
},
+ "nix-filter": {
+ "locked": {
+ "lastModified": 1693833173,
+ "narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=",
+ "owner": "numtide",
+ "repo": "nix-filter",
+ "rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "nix-filter",
+ "type": "github"
+ }
+ },
"nixpkgs": {
"locked": {
"lastModified": 1693626178,
@@ -156,6 +171,7 @@
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"libnbtplusplus": "libnbtplusplus",
+ "nix-filter": "nix-filter",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
diff --git a/flake.nix b/flake.nix
index a58d66fb..afb0ec63 100644
--- a/flake.nix
+++ b/flake.nix
@@ -4,6 +4,7 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
+ nix-filter.url = "github:numtide/nix-filter";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
diff --git a/nix/distribution.nix b/nix/distribution.nix
index c8fa01c5..ca9999dc 100644
--- a/nix/distribution.nix
+++ b/nix/distribution.nix
@@ -26,11 +26,27 @@
overlays.default = final: prev: let
version = builtins.substring 0 8 self.lastModifiedDate or "dirty";
+ filteredSelf = inputs.nix-filter.lib.filter {
+ root = ../.;
+ include = [
+ "buildconfig"
+ "cmake"
+ "launcher"
+ "libraries"
+ "program_info"
+ "tests"
+ ../COPYING.md
+ ../CMakeLists.txt
+ ];
+ };
+
# common args for prismlauncher evaluations
unwrappedArgs = {
+ self = filteredSelf;
+
inherit (inputs) libnbtplusplus;
inherit ((final.darwin or prev.darwin).apple_sdk.frameworks) Cocoa;
- inherit self version;
+ inherit version;
};
in {
prismlauncher-qt5-unwrapped = prev.libsForQt5.callPackage ./pkg unwrappedArgs;