diff options
author | Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> | 2023-03-24 12:06:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-24 12:06:26 +0100 |
commit | eed43de02f15c450934edfb7acc7b8df37a7c388 (patch) | |
tree | c0f76d87973c3507d0489f41c72f6be3cb184e65 | |
parent | fbc296e00fa05703ea08f9ec478a3cfe11abf3e2 (diff) | |
parent | 80f9231b69916100f622008f490ec6813fcd994b (diff) |
Merge pull request #8096 from tweag/filter-tests
Filter tests/nixos from source
-rw-r--r-- | flake.nix | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -319,12 +319,18 @@ }; let canRunInstalled = currentStdenv.buildPlatform.canExecute currentStdenv.hostPlatform; + + sourceByRegexInverted = rxs: origSrc: final.lib.cleanSourceWith { + filter = (path: type: + let relPath = final.lib.removePrefix (toString origSrc + "/") (toString path); + in ! lib.any (re: builtins.match re relPath != null) rxs); + src = origSrc; + }; in currentStdenv.mkDerivation (finalAttrs: { name = "nix-${version}"; inherit version; - src = self; - + src = sourceByRegexInverted [ "tests/nixos/.*" "tests/installer/.*" ] self; VERSION_SUFFIX = versionSuffix; outputs = [ "out" "dev" "doc" ]; |