Add documentation for unbound configs
authorBobbe <redacted>
Fri, 27 Mar 2026 18:11:49 +0000 (19:11 +0100)
committerBobbe <redacted>
Mon, 27 Apr 2026 12:23:13 +0000 (14:23 +0200)
readme_template.md

index bab551805a64c7319263902ec05fe95f03a32830..4c66936f6890935c1ee5135a4408c7c439b3f988 100644 (file)
@@ -386,8 +386,10 @@ To install hosts file on your machine add the following into your
 
 ### Nix Flake
 
-NixOS installations which are managed through _flakes_ can use the hosts file
-like this:
+NixOS installations which are managed through _flakes_ can directly use the `flake.nix` in this repository as an input.
+
+It contains a `nixosModule` that can be used to install the `hosts` file locally, as well as a package containing config files for the [Unbound](https://github.com/NLnetLabs/unbound) DNS server to be used as blocklists.
+
 
 ```nix
 {
@@ -403,7 +405,9 @@ like this:
     nixosConfigurations.my-hostname = {
       system = "<architecture>";
       modules = [
-        hosts.nixosModule {
+        # nixosModule to install hosts file locally:
+        hosts.nixosModule
+        {
           networking.stevenBlackHosts = {
             enable = true;
             # optionally:
@@ -414,6 +418,19 @@ like this:
             # blockSocial = true;
           };
         }
+
+        # configure unbound to use config as blocklist:
+        {
+          {
+            services.unbound = {
+              enable = true;
+              settings.server.include = [
+                "${hosts.packages.${system}.unbound}/hosts"
+                # alternates are also available, e.g. /fakenews, /fakenews-gambling etc.
+              ];
+            };
+          }
+        }
       ];
     };
   };
git clone https://git.99rst.org/PROJECT