Skip to content

Commit

Permalink
use fileset intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed May 28, 2024
1 parent c102537 commit 5ad54d7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,22 @@
if lib.isDerivation defaultShell
then "${defaultShell}${defaultShell.passthru.shellPath}"
else defaultShell;
fs = lib.fileset;
r = ./.;
in
stdenv.mkDerivation {
name = "noshell";

src = lib.cleanSource ./.;
src = fs.toSource {
root = r;
fileset = fs.intersection (lib.fileset.fromSource (lib.sources.cleanSource r)) (
lib.fileset.unions [
(fs.fileFilter (file: file.hasExt "c") r)
(fs.fileFilter (file: file.hasExt "txt") r)
(fs.fileFilter (file: file.hasExt "in") r)
]
);
};

nativeBuildInputs = [cmake];

Expand Down

0 comments on commit 5ad54d7

Please sign in to comment.