Skip to content

Commit

Permalink
syncthing: apply autoSignDarwinBinariesHook
Browse files Browse the repository at this point in the history
Somewhere between macOS 13.0.1 and 13.2.1, launchd started rejecting
binaries that aren't signed in Launch Agents/Daemons. This is the case
even on x86 devices, which has a more lax code signing policy compared
to Apple Silicon. This change signs Syncthing binaries so that it can be
auto-started at login by launchd.
  • Loading branch information
midchildan committed Mar 21, 2023
1 parent a8cb031 commit 8da60f2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion pkgs/applications/networking/syncthing/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{ pkgsBuildBuild, go, buildGoModule, stdenv, lib, procps, fetchFromGitHub, nixosTests }:
{ pkgsBuildBuild
, go
, buildGoModule
, stdenv
, lib
, procps
, fetchFromGitHub
, nixosTests
, autoSignDarwinBinariesHook
}:

let
common = { stname, target, postInstall ? "" }:
Expand All @@ -15,6 +24,15 @@ let

vendorHash = "sha256-5NgflkRXkbWiIkASmxIgWliE8sF89HtlMtlIF+5u6Ic=";

nativeBuildInputs = lib.optionals stdenv.isDarwin [
# Recent versions of macOS seem to require binaries to be signed when
# run from Launch Agents/Daemons, even on x86 devices where it has a
# more lax code signing policy compared to Apple Silicon. So just sign
# the binaries on both architectures to make it possible for launchd to
# auto-start Syncthing at login.
autoSignDarwinBinariesHook
];

doCheck = false;

BUILD_USER = "nix";
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33598,6 +33598,7 @@ with pkgs;
syncterm = callPackage ../applications/terminal-emulators/syncterm { };

inherit (callPackages ../applications/networking/syncthing {
inherit (darwin) autoSignDarwinBinariesHook;
buildGoModule = buildGo119Module; # go 1.20 build failure
})
syncthing
Expand Down

0 comments on commit 8da60f2

Please sign in to comment.