tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
networkd-dispatcher: Add patch support store files
Jonas Heinrich
2 years ago
22fd05ad
26e14e57
+19
2 changed files
expand all
collapse all
unified
split
pkgs
tools
networking
networkd-dispatcher
default.nix
support_nix_store_path.patch
+6
pkgs/tools/networking/networkd-dispatcher/default.nix
···
19
19
hash = "sha256-yO9/HlUkaQmW/n9N3vboHw//YMzBjxIHA2zAxgZNEv0=";
20
20
};
21
21
22
22
+
patches = [
23
23
+
# Support rule files in NixOS store paths. Required for the networkd-dispatcher
24
24
+
# module to work
25
25
+
./support_nix_store_path.patch
26
26
+
];
27
27
+
22
28
postPatch = ''
23
29
# Fix paths in systemd unit file
24
30
substituteInPlace networkd-dispatcher.service \
+13
pkgs/tools/networking/networkd-dispatcher/support_nix_store_path.patch
···
1
1
+
diff --git a/networkd-dispatcher b/networkd-dispatcher
2
2
+
index ef877ce..8c341f2 100755
3
3
+
--- a/networkd-dispatcher
4
4
+
+++ b/networkd-dispatcher
5
5
+
@@ -171,6 +171,8 @@ def check_perms(path, mode=0o755, uid=0, gid=0):
6
6
+
7
7
+
if not os.path.exists(path):
8
8
+
raise FileNotFoundError
9
9
+
+ if re.search('^/nix/store/.*', str(path)):
10
10
+
+ return True
11
11
+
st = os.stat(path, follow_symlinks=False)
12
12
+
st_mode = st.st_mode & 0x00FFF
13
13
+
if st.st_uid == uid and st.st_gid == gid and st_mode == mode: