about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorBernardo Meurer <bernardo@meurer.org>2023-03-28 09:23:31 -0300
committerGitHub <noreply@github.com>2023-03-28 09:23:31 -0300
commitb2cb194047fa89777345a040f6190654bcc4f65d (patch)
tree9d60e0d477f237a62295db20147a192b6e83cf16 /pkgs/applications
parentbd4e35e14a0130268c8f7b253a15e09d76ec95b7 (diff)
parent8da60f204ffc26b6ac59b39568071fa4e3276412 (diff)
Merge pull request #222347 from midchildan/feat/syncthing/darwin-codesign
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/networking/syncthing/default.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix
index 952851b08dbac..0ddf1fc8f9ccc 100644
--- a/pkgs/applications/networking/syncthing/default.nix
+++ b/pkgs/applications/networking/syncthing/default.nix
@@ -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 ? "" }:
@@ -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";