Skip to content

Commit

Permalink
Merge pull request NixOS#8096 from tweag/filter-tests
Browse files Browse the repository at this point in the history
Filter tests/nixos from source
  • Loading branch information
thufschmitt authored Mar 24, 2023
2 parents fbc296e + 80f9231 commit eed43de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];
Expand Down

0 comments on commit eed43de

Please sign in to comment.