Skip to content

Commit

Permalink
Nix: Use builtins.path
Browse files Browse the repository at this point in the history
this way, we get consistent store paths independent of wether we have
the sources locally, or get them via `fetchGit`.

See NixOS/nix#1305
  • Loading branch information
nomeata committed Mar 25, 2019
1 parent 91d6bf3 commit 26ed2f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@

let stdenv = nixpkgs.stdenv; in

let sourceByRegex = src: regexes: builtins.filterSource (path: type:
let sourceByRegex = src: regexes: builtins.path
{ name = "actorscript";
path = src;
filter = path: type:
let relPath = nixpkgs.lib.removePrefix (toString src + "/") (toString path); in
let match = builtins.match (nixpkgs.lib.strings.concatStringsSep "|" regexes); in
( type == "directory" && match (relPath + "/") != null
|| match relPath != null)) src; in
( type == "directory" && match (relPath + "/") != null || match relPath != null);
}; in

let ocaml_wasm = (import ./nix/ocaml-wasm.nix) {
inherit (nixpkgs) stdenv fetchFromGitHub ocaml;
Expand Down

0 comments on commit 26ed2f1

Please sign in to comment.