diff options
Diffstat (limited to 'pkgs/applications/networking/syncthing/default.nix')
-rw-r--r-- | pkgs/applications/networking/syncthing/default.nix | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix index cc916e069a005..5b847163a2a7a 100644 --- a/pkgs/applications/networking/syncthing/default.nix +++ b/pkgs/applications/networking/syncthing/default.nix @@ -1,21 +1,21 @@ -{ buildGoPackage, stdenv, lib, procps, fetchFromGitHub }: +{ buildGoModule, stdenv, lib, procps, fetchFromGitHub }: let common = { stname, target, postInstall ? "" }: - buildGoPackage rec { - version = "1.1.4"; + buildGoModule rec { + version = "1.2.1"; name = "${stname}-${version}"; src = fetchFromGitHub { owner = "syncthing"; repo = "syncthing"; rev = "v${version}"; - sha256 = "0a19l1kp4cwyzcd53v9yzv3ms69gn78gajkyfawafr7ls0i8x82f"; + sha256 = "0q1x6kd5kaij8mvs6yll2vqfzrbb31y5hpg6g5kjc8gngwv4rl6v"; }; goPackagePath = "github.com/syncthing/syncthing"; - goDeps = ./deps.nix; + modSha256 = "1daixrpdj97ck02853hwp8l158sja5a7a37h0gdbwb1lgf5hsn05"; patches = [ ./add-stcli-target.patch @@ -25,18 +25,14 @@ let buildPhase = '' runHook preBuild - pushd go/src/${goPackagePath} go run build.go -no-upgrade -version v${version} build ${target} - popd runHook postBuild ''; installPhase = '' - pushd go/src/${goPackagePath} runHook preInstall - install -Dm755 ${target} $bin/bin/${target} + install -Dm755 ${target} $out/bin/${target} runHook postInstall - popd ''; inherit postInstall; @@ -65,19 +61,19 @@ in { done '' + lib.optionalString (stdenv.isLinux) '' - mkdir -p $bin/lib/systemd/{system,user} + mkdir -p $out/lib/systemd/{system,user} substitute etc/linux-systemd/system/syncthing-resume.service \ - $bin/lib/systemd/system/syncthing-resume.service \ + $out/lib/systemd/system/syncthing-resume.service \ --replace /usr/bin/pkill ${procps}/bin/pkill substitute etc/linux-systemd/system/syncthing@.service \ - $bin/lib/systemd/system/syncthing@.service \ - --replace /usr/bin/syncthing $bin/bin/syncthing + $out/lib/systemd/system/syncthing@.service \ + --replace /usr/bin/syncthing $out/bin/syncthing substitute etc/linux-systemd/user/syncthing.service \ - $bin/lib/systemd/user/syncthing.service \ - --replace /usr/bin/syncthing $bin/bin/syncthing + $out/lib/systemd/user/syncthing.service \ + --replace /usr/bin/syncthing $out/bin/syncthing ''; }; @@ -101,7 +97,7 @@ in { substitute cmd/strelaysrv/etc/linux-systemd/strelaysrv.service \ $out/lib/systemd/system/strelaysrv.service \ - --replace /usr/bin/strelaysrv $bin/bin/strelaysrv + --replace /usr/bin/strelaysrv $out/bin/strelaysrv ''; }; } |