mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
Merge pull request #218280 from thequux/set-pdns-config-dir
powerdns, pdns-recursor: find config in /etc by default
This commit is contained in:
commit
99d4bf7bab
@ -159,6 +159,8 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.etc."pdns-recursor".source = configDir;
|
||||
|
||||
services.pdns-recursor.settings = mkDefaultAttrs {
|
||||
local-address = cfg.dns.address;
|
||||
local-port = cfg.dns.port;
|
||||
|
@ -38,6 +38,8 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.etc.pdns.source = finalConfigDir;
|
||||
|
||||
systemd.packages = [ pkgs.pdns ];
|
||||
|
||||
systemd.services.pdns = {
|
||||
|
@ -28,8 +28,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
import re
|
||||
|
||||
with subtest("PowerDNS database exists"):
|
||||
server.wait_for_unit("mysql")
|
||||
server.succeed("echo 'SHOW DATABASES;' | sudo -u pdns mysql -u pdns >&2")
|
||||
@ -46,11 +44,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
||||
|
||||
with subtest("Adding an example zone works"):
|
||||
# Extract configuration file needed by pdnsutil
|
||||
unit = server.succeed("systemctl cat pdns")
|
||||
match = re.search("(--config-dir=[^ ]+)", unit)
|
||||
assert(match is not None)
|
||||
conf = match.group(1)
|
||||
pdnsutil = "sudo -u pdns pdnsutil " + conf
|
||||
pdnsutil = "sudo -u pdns pdnsutil "
|
||||
server.succeed(f"{pdnsutil} create-zone example.com ns1.example.com")
|
||||
server.succeed(f"{pdnsutil} add-record example.com ns1 A 192.168.1.2")
|
||||
|
||||
|
@ -21,8 +21,11 @@ stdenv.mkDerivation rec {
|
||||
configureFlags = [
|
||||
"--enable-reproducible"
|
||||
"--enable-systemd"
|
||||
"sysconfdir=/etc/pdns-recursor"
|
||||
];
|
||||
|
||||
installFlags = [ "sysconfdir=$(out)/etc/pdns-recursor" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru.tests = {
|
||||
|
@ -69,6 +69,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"--with-libsodium"
|
||||
"--with-sqlite3"
|
||||
"--with-libcrypto=${openssl.dev}"
|
||||
"sysconfdir=/etc/pdns"
|
||||
];
|
||||
|
||||
# nix destroy with-modules arguments, when using configureFlags
|
||||
@ -79,6 +80,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
)
|
||||
'';
|
||||
|
||||
# We want the various utilities to look for the powerdns config in
|
||||
# /etc/pdns, but to actually install the sample config file in
|
||||
# $out
|
||||
installFlags = [ "sysconfdir=$(out)/etc/pdns" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
doCheck = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user