diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index 0980a464704..32b20769647 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -82,4 +82,13 @@ rec { else head xs == head ys && eqLists (tail xs) (tail ys); + # Bring in a path as a source, filtering out all hidden Subversion + # directories. TODO: filter out backup files (*~) etc. + cleanSource = + let filter = name: type: + type != "directory" + || baseNameOf (toString name) != ".svn"; + in src: builtins.filterSource filter src; + + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c3881bebd7c..49c881c9812 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -121,6 +121,8 @@ rec { useFromStdenv = hasIt: it: alternative: if hasIt then it else alternative; + lib = library; + library = import ../lib; # Return an attribute from the Nixpkgs configuration file, or @@ -204,11 +206,6 @@ rec { # derivations, e.g., "... ${somePkg}/bin/foo ...". writeText = name: text: runCommand name {inherit text;} "echo \"$text\" > $out"; - # Bring in a path as a source, filtering out all hidden Subversion - # directories. TODO: filter out backup files (*~) etc. - cleanSource = src: builtins.filterSource - (name: baseNameOf (toString name) != ".svn") src; - substituteAll = import ../build-support/substitute/substitute-all.nix { inherit stdenv; };