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:
parent
2730aa3909
commit
4de6aaea5d
15
default.nix
15
default.nix
|
@ -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"
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue