Revert "refactor(nix): nix-filter -> lib.fileset"

This reverts commit 8312713dc2.

See nix#9428. Path coercion like `"${./.}"` in flakes causes the path to
be copied to the store twice; using the `self` argument works around
this. However, as `lib.fileset` doesn't support using `self`, so we need
to go back to `nix-filter`

Signed-off-by: seth <getchoo@tuta.io>
This commit is contained in:
seth 2024-08-21 03:42:40 -04:00
parent 13eedbb7de
commit a49a58bc45
No known key found for this signature in database
GPG Key ID: D31BD0D494BBEE86
3 changed files with 41 additions and 15 deletions

16
flake.lock generated
View File

@ -32,6 +32,21 @@
"type": "github" "type": "github"
} }
}, },
"nix-filter": {
"locked": {
"lastModified": 1710156097,
"narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "3342559a24e85fc164b295c3444e8a139924675b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1723637854, "lastModified": 1723637854,
@ -52,6 +67,7 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"libnbtplusplus": "libnbtplusplus", "libnbtplusplus": "libnbtplusplus",
"nix-filter": "nix-filter",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View File

@ -14,6 +14,8 @@
flake = false; flake = false;
}; };
nix-filter.url = "github:numtide/nix-filter";
/* /*
Inputs below this are optional and can be removed Inputs below this are optional and can be removed
@ -40,6 +42,7 @@
self, self,
nixpkgs, nixpkgs,
libnbtplusplus, libnbtplusplus,
nix-filter,
... ...
}: }:
let let
@ -86,7 +89,14 @@
version = builtins.substring 0 8 self.lastModifiedDate or "dirty"; version = builtins.substring 0 8 self.lastModifiedDate or "dirty";
in in
{ {
prismlauncher-unwrapped = prev.callPackage ./nix/unwrapped.nix { inherit libnbtplusplus version; }; prismlauncher-unwrapped = prev.callPackage ./nix/unwrapped.nix {
inherit
libnbtplusplus
nix-filter
self
version
;
};
prismlauncher = final.callPackage ./nix/wrapper.nix { }; prismlauncher = final.callPackage ./nix/wrapper.nix { };
}; };

View File

@ -10,6 +10,8 @@
jdk17, jdk17,
kdePackages, kdePackages,
ninja, ninja,
nix-filter,
self,
stripJavaArchivesHook, stripJavaArchivesHook,
tomlplusplus, tomlplusplus,
zlib, zlib,
@ -27,20 +29,18 @@ stdenv.mkDerivation {
pname = "prismlauncher-unwrapped"; pname = "prismlauncher-unwrapped";
inherit version; inherit version;
src = lib.fileset.toSource { src = nix-filter.lib {
root = ../.; root = self;
fileset = lib.fileset.unions ( include = [
map (fileName: ../${fileName}) [ "buildconfig"
"buildconfig" "cmake"
"cmake" "launcher"
"launcher" "libraries"
"libraries" "program_info"
"program_info" "tests"
"tests" ../COPYING.md
"COPYING.md" ../CMakeLists.txt
"CMakeLists.txt" ];
]
);
}; };
postUnpack = '' postUnpack = ''