From 5ad54d75015ef080236af9897206fe2760a77786 Mon Sep 17 00:00:00 2001 From: Fernando Ayats Date: Tue, 28 May 2024 14:39:35 +0200 Subject: [PATCH] use fileset intersection --- package.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/package.nix b/package.nix index bb45f1e..28b45aa 100644 --- a/package.nix +++ b/package.nix @@ -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];