Use runCommandLocal instead of mkDerivation, pipe instead of cat
authorBobbe <redacted>
Tue, 24 Mar 2026 14:59:11 +0000 (15:59 +0100)
committerBobbe <redacted>
Mon, 27 Apr 2026 12:11:42 +0000 (14:11 +0200)
unbound.nix

index 72551f2213c14b149c9fc3c83bfb75e26a044841..1e9aa3d700ca37336c5bda0d837aef13e1a8b969 100644 (file)
@@ -1,19 +1,13 @@
 {
-  stdenvNoCC,
+  runCommandLocal,
 }:
-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
-    '';
-}
+let
+  toUnboundConf = ''awk 'NF == 2 && $1 == "0.0.0.0" && $2 != "0.0.0.0" { printf "local-zone: \"%s\" always_nxdomain\n", $2 }'\'';
+in
+runCommandLocal "stevenblack-hosts-unbound" { src = ./.; } ''
+  mkdir $out
+  ${toUnboundConf} < $src/hosts > $out/hosts
+  for file in alternates/*/hosts; do
+    ${toUnboundConf} < $file > $out/$(basename $(dirname $file))
+  done
+''
git clone https://git.99rst.org/PROJECT