Skip to content

Commit 549cc5e

Browse files
nqptp: copy systemd service and add capability (#350818)
2 parents 5957ab0 + 3591d63 commit 549cc5e

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)