Skip to content

Commit 3591d63

Browse files
committed
nqptp: copy systemd service and add capability
The binary has its capability to listen on ports removed, and upstream has already moved to AmbientCapabilities in the systemd service instead of using setcap. Copying the systemd service allows using the package with `systemd.packages`. The patch should be removed after version 1.2.4, along with the other patch. The patch is taken from [commit 050a8c2][1] in the upstream repository. [1]: mikebrady/nqptp@050a8c2
1 parent 5c8ff2e commit 3591d63

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

pkgs/tools/networking/nqptp/default.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ stdenv.mkDerivation rec {
1818
};
1919

2020
patches = [
21-
# this patch should be removed when > 1.2.4
21+
# these patches should be removed when > 1.2.4
2222
./remove-setcap.patch
23+
./systemd-service-capability.patch
2324
];
2425

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

32+
postInstall = ''
33+
mkdir -p $out/lib/systemd/system
34+
cp nqptp.service $out/lib/systemd/system
35+
'';
36+
3137
meta = {
3238
homepage = "https://github.com/mikebrady/nqptp";
3339
description = "Daemon and companion application to Shairport Sync that monitors timing data from any PTP clocks";
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/nqptp.service.in b/nqptp.service.in
2+
index 6f1eb0c..53e6a2e 100644
3+
--- a/nqptp.service.in
4+
+++ b/nqptp.service.in
5+
@@ -8,6 +8,7 @@ Before=shairport-sync.service
6+
ExecStart=@prefix@/bin/nqptp
7+
User=nqptp
8+
Group=nqptp
9+
+AmbientCapabilities=CAP_NET_BIND_SERVICE
10+
11+
[Install]
12+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)