Add unbound config nix package

This commit is contained in:
Yethal
2026-04-27 14:11:42 +02:00
committed by Bobbe
parent 46c0aa9d8b
commit 44d7516aeb
2 changed files with 25 additions and 1 deletions
+6 -1
View File
@@ -52,6 +52,11 @@
python3Packages.requests
];
};
});
}
);
packages = forAllSystems (system: {
unbound = nixpkgsFor.${system}.callPackage ./unbound.nix { };
});
};
}
+19
View File
@@ -0,0 +1,19 @@
{
stdenvNoCC,
}:
stdenvNoCC.mkDerivation {
name = "stevenblack-hosts-unbound";
src = ./.;
installPhase =
let
toUnboundConf = ''awk 'NF == 2 && $1 == "0.0.0.0" && $2 != "0.0.0.0" { printf "local-zone: \"%s\" always_nxdomain\n", $2 }'\'';
in
''
mkdir $out
cat $src/hosts | ${toUnboundConf} > $out/hosts
for file in alternates/*/hosts; do
cat $file | ${toUnboundConf} > $out/$(basename $(dirname $file))
done
'';
}