Skip to content

Commit

Permalink
Problem: extractPath doesn't work on Nix/Darwin
Browse files Browse the repository at this point in the history
The regular expression is valid on Nix/Linux but not on Nix/Darwin.

Solution: Use builtins.split instead.

Closes fractalide#100
  • Loading branch information
clacke committed Mar 31, 2018
1 parent 70596c2 commit a7866c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nix/racket2nix.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
let
extractPath = lib.makeOverridable ({ path, src }: stdenv.mkDerivation {
inherit path src;
name = builtins.elemAt (builtins.match "(|.*/)([^/]*)" path) 1;
name = let
pathComponents = builtins.split "/" path;
numComponents = builtins.length pathComponents;
in builtins.elemAt pathComponents (numComponents - 1);
phases = "unpackPhase installPhase";
installPhase = ''
cp -a "${path}" $out
Expand Down

0 comments on commit a7866c5

Please sign in to comment.