about summary refs log tree commit diff
path: root/pkgs/applications/networking/syncthing/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/networking/syncthing/default.nix')
-rw-r--r--pkgs/applications/networking/syncthing/default.nix13
1 files changed, 4 insertions, 9 deletions
diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix
index 95ab09542a07..2cb4f0a5922e 100644
--- a/pkgs/applications/networking/syncthing/default.nix
+++ b/pkgs/applications/networking/syncthing/default.nix
@@ -1,11 +1,6 @@
-{ stdenv, lib, fetchFromGitHub, go, pkgs }:
+{ stdenv, lib, fetchFromGitHub, go, pkgs, removeReferencesTo }:
 
-let
-  removeExpr = ref: ''
-    sed -i "s,${ref},$(echo "${ref}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" \
-  '';
-
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   version = "0.14.24";
   name = "syncthing-${version}";
 
@@ -16,7 +11,7 @@ in stdenv.mkDerivation rec {
     sha256 = "15jjk49ibry7crc3sw5zg09zsm5ir0ph5c0f3acas66wd02rnvl1";
   };
 
-  buildInputs = [ go ];
+  buildInputs = [ go removeReferencesTo ];
 
   buildPhase = ''
     mkdir -p src/github.com/syncthing
@@ -48,7 +43,7 @@ in stdenv.mkDerivation rec {
   '';
 
   preFixup = ''
-    find $out/bin -type f -exec ${removeExpr go} '{}' '+'
+    find $out/bin -type f -exec remove-references-to -t ${go} '{}' '+'
   '';
 
   meta = with stdenv.lib; {