knot-resolver*_6: simplify path overrides
This commit is contained in:
@@ -23,7 +23,6 @@ python3Packages.buildPythonPackage {
|
||||
# But the install-time etc differs from a sensible run-time etc.
|
||||
postPatch = ''
|
||||
substitute '${knot-resolver.unwrapped.config_py}'/knot_resolver/constants.py ./python/knot_resolver/constants.py \
|
||||
--replace-fail '${knot-resolver.unwrapped.out}/etc' '/etc' \
|
||||
--replace-fail '${knot-resolver.unwrapped.out}/sbin' '${knot-resolver}/bin'
|
||||
''
|
||||
# On non-Linux let's simplify construction of the knot-resolver command line,
|
||||
|
||||
@@ -56,20 +56,12 @@ let
|
||||
excludes = [ "NEWS" ];
|
||||
hash = "sha256-3w33v8UfhGdA50BlkfHpQLFxg+5ELk0lp7RzgvkSzK8=";
|
||||
})
|
||||
# Install-time paths sometimes differ from run-time paths in nixpkgs.
|
||||
./paths.patch
|
||||
];
|
||||
|
||||
# Path fixups for the NixOS service.
|
||||
# systemd Exec* options are difficult to override in NixOS *if present*, so we drop them.
|
||||
postPatch = ''
|
||||
patch meson.build <<EOF
|
||||
@@ -50,2 +50,3 @@
|
||||
-systemd_work_dir = prefix / get_option('localstatedir') / 'lib' / 'knot-resolver'
|
||||
-systemd_cache_dir = prefix / get_option('localstatedir') / 'cache' / 'knot-resolver'
|
||||
+systemd_work_dir = '/var/lib/knot-resolver'
|
||||
+systemd_cache_dir = '/var/cache/knot-resolver'
|
||||
+run_dir = '/run/knot-resolver'
|
||||
EOF
|
||||
|
||||
sed -e '/^ExecStart=/d' -e '/^ExecReload=/d' \
|
||||
-i systemd/knot-resolver.service.in
|
||||
''
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -50,2 +50,3 @@
|
||||
-systemd_work_dir = prefix / get_option('localstatedir') / 'lib' / 'knot-resolver'
|
||||
-systemd_cache_dir = prefix / get_option('localstatedir') / 'cache' / 'knot-resolver'
|
||||
+systemd_work_dir = '/var/lib/knot-resolver'
|
||||
+systemd_cache_dir = '/var/cache/knot-resolver'
|
||||
+run_dir = '/run/knot-resolver'
|
||||
|
||||
--- a/python/knot_resolver/constants.py.in
|
||||
+++ b/python/knot_resolver/constants.py.in
|
||||
@@ -12 +12 @@
|
||||
-ETC_DIR = Path("@etc_dir@")
|
||||
+ETC_DIR = Path("/etc/knot-resolver")
|
||||
Reference in New Issue
Block a user