Note that the regular expression that builtins.match accepts already
supports disjunction using: "a|b". So your example application could be
rewritten using:
sourceByRegex /tmp/sourcetest [".*hs$|someTestFile"]
suggesting that the list of regexes could be replaced by a single regex:
sourceBy
Awesome function indeed!
TIL there exists builtins.match and it's not documented in the manual[1].
I would like to switch from my whitelistSource to your sourceByRegex so a
PR would be much appreciated indeed.
Bas
[1] http://nixos.org/nix/manual/#ssec-builtins
On 17 February 2017 at 11:16, Tho
Awesome function Thomas!
Would you be willing to open a PR on nixpkgs for that?
2017-02-17 11:16 GMT+01:00 Thomas Hunger :
> Thanks for your replies everyone!
>
> Bas - your "toString" helped me over the finishing line. Pretty obvious in
> hindsight to use toString to force evaluation of src. I
Thanks for your replies everyone!
Bas - your "toString" helped me over the finishing line. Pretty obvious in
hindsight to use toString to force evaluation of src. I adapted your code
to this:
sourceByRegex = src: regexes: builtins.filterSource (path: type:
let relPath = lib.removePrefix (toSt
At LumiGuide we're using the following function in our Haskell packages:
# Copy everything under src into the Nix store except those paths that
don't
# have one of the specified allowedPrefixes.
whitelistSource = src: allowedPrefixes:
builtins.filterSource
(path: type:
lib.
I've been using filterSource. It works okay but is a bit too generic. It
would be nice to have a function that understands a gitignore-like syntax.
On Thu, 16 Feb 2017, 12:44 Profpatsch, wrote:
> On 17-02-16 01:28pm, Freddy Rietdijk wrote:
> > > src = [ ./subproject-A/schema.sql ./subproject-A/l
On 17-02-16 01:28pm, Freddy Rietdijk wrote:
> > src = [ ./subproject-A/schema.sql ./subproject-A/lib ];
>
> Each of the files you mentioned here will be stored in a separate store
> path. You could write a simple function that takes a list of derivations
> and copies the contents of those derivati
On 16/02/17 12:28, Freddy Rietdijk wrote:
>> src = [ ./subproject-A/schema.sql ./subproject-A/lib ];
>
> Each of the files you mentioned here will be stored in a separate store
> path. You could write a simple function that takes a list of derivations
> and copies the contents of those derivations
> src = [ ./subproject-A/schema.sql ./subproject-A/lib ];
Each of the files you mentioned here will be stored in a separate store
path. You could write a simple function that takes a list of derivations
and copies the contents of those derivations in a new output.
On Thu, Feb 16, 2017 at 1:14 PM,
Hi,
I am consistently struggling with the following in nix: I have a repository
and I want to specify derivations for some local sub-projects. The obvious
solution is
src = ./subproject-A;
But that pulls in everything in that directory, including build artifacts,
or random intermediate data fi
10 matches
Mail list logo