Skip to content

Commit

Permalink
nqptp: copy systemd service and add capability (#350818)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcstephens authored Oct 24, 2024
2 parents 5957ab0 + 3591d63 commit 549cc5e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkgs/tools/networking/nqptp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ stdenv.mkDerivation rec {
};

patches = [
# this patch should be removed when > 1.2.4
# these patches should be removed when > 1.2.4
./remove-setcap.patch
./systemd-service-capability.patch
];

nativeBuildInputs = [ autoreconfHook pkg-config ];
Expand All @@ -28,6 +29,11 @@ stdenv.mkDerivation rec {
ignoredVersions = ".*(-dev|d0)";
};

postInstall = ''
mkdir -p $out/lib/systemd/system
cp nqptp.service $out/lib/systemd/system
'';

meta = {
homepage = "https://github.com/mikebrady/nqptp";
description = "Daemon and companion application to Shairport Sync that monitors timing data from any PTP clocks";
Expand Down
12 changes: 12 additions & 0 deletions pkgs/tools/networking/nqptp/systemd-service-capability.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/nqptp.service.in b/nqptp.service.in
index 6f1eb0c..53e6a2e 100644
--- a/nqptp.service.in
+++ b/nqptp.service.in
@@ -8,6 +8,7 @@ Before=shairport-sync.service
ExecStart=@prefix@/bin/nqptp
User=nqptp
Group=nqptp
+AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

0 comments on commit 549cc5e

Please sign in to comment.