1
0
Fork 0
mirror of https://github.com/NixOS/nix-pills synced 2024-09-19 04:00:13 -04:00

Allow *.nix just within subdirectories

This commit is contained in:
John Ericson 2018-02-23 18:26:47 -05:00
parent 2730aa3909
commit 4de6aaea5d

View file

@ -1,7 +1,20 @@
{ pkgs ? import <nixpkgs> {}, revCount, shortRev }:
let
lib = pkgs.lib;
sources = lib.sourceFilesBySuffices ./. [ ".xml" ".txt" ];
sources = let
# We want nix examples, but not the top level nix to build things
noTopLevelNix = path: type: let
relPath = lib.removePrefix (toString ./. + "/") (toString path);
in builtins.match "[^/]*\.nix" relPath == null;
extensions = [ ".xml" ".txt" ".nix" ".bash" ];
in lib.cleanSourceWith {
filter = noTopLevelNix;
src = lib.sourceFilesBySuffices ./. extensions;
};
combined = pkgs.runCommand "nix-pills-combined"
{