lol

nixos/blocky: init

+88
+7
nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
··· 214 214 <link xlink:href="options.html#opt-services.headscale.enable">services.headscale</link> 215 215 </para> 216 216 </listitem> 217 + <listitem> 218 + <para> 219 + <link xlink:href="https://0xerr0r.github.io/blocky/">blocky</link>, 220 + fast and lightweight DNS proxy as ad-blocker for local network 221 + with many features. 222 + </para> 223 + </listitem> 217 224 </itemizedlist> 218 225 </section> 219 226 <section xml:id="sec-release-22.05-incompatibilities">
+2
nixos/doc/manual/release-notes/rl-2205.section.md
··· 65 65 66 66 - [headscale](https://github.com/juanfont/headscale), an Open Source implementation of the [Tailscale](https://tailscale.io) Control Server. Available as [services.headscale](options.html#opt-services.headscale.enable) 67 67 68 + - [blocky](https://0xerr0r.github.io/blocky/), fast and lightweight DNS proxy as ad-blocker for local network with many features. 69 + 68 70 <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. --> 69 71 70 72 ## Backward Incompatibilities {#sec-release-22.05-incompatibilities}
+1
nixos/modules/module-list.nix
··· 716 716 ./services/networking/bird.nix 717 717 ./services/networking/bitlbee.nix 718 718 ./services/networking/blockbook-frontend.nix 719 + ./services/networking/blocky.nix 719 720 ./services/networking/charybdis.nix 720 721 ./services/networking/cjdns.nix 721 722 ./services/networking/cntlm.nix
+40
nixos/modules/services/networking/blocky.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.services.blocky; 7 + 8 + format = pkgs.formats.yaml { }; 9 + configFile = format.generate "config.yaml" cfg.settings; 10 + in 11 + { 12 + options.services.blocky = { 13 + enable = mkEnableOption "Fast and lightweight DNS proxy as ad-blocker for local network with many features"; 14 + 15 + settings = mkOption { 16 + type = format.type; 17 + default = { }; 18 + description = '' 19 + Blocky configuration. Refer to 20 + <link xlink:href="https://0xerr0r.github.io/blocky/configuration/"/> 21 + for details on supported values. 22 + ''; 23 + }; 24 + }; 25 + 26 + config = mkIf cfg.enable { 27 + systemd.services.blocky = { 28 + description = "A DNS proxy and ad-blocker for the local network"; 29 + wantedBy = [ "multi-user.target" ]; 30 + 31 + serviceConfig = { 32 + DynamicUser = true; 33 + ExecStart = "${pkgs.blocky}/bin/blocky --config ${configFile}"; 34 + 35 + AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; 36 + CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; 37 + }; 38 + }; 39 + }; 40 + }
+1
nixos/tests/all-tests.nix
··· 51 51 bitcoind = handleTest ./bitcoind.nix {}; 52 52 bittorrent = handleTest ./bittorrent.nix {}; 53 53 blockbook-frontend = handleTest ./blockbook-frontend.nix {}; 54 + blocky = handleTest ./blocky.nix {}; 54 55 boot = handleTestOn ["x86_64-linux" "aarch64-linux"] ./boot.nix {}; 55 56 boot-stage1 = handleTest ./boot-stage1.nix {}; 56 57 borgbackup = handleTest ./borgbackup.nix {};
+34
nixos/tests/blocky.nix
··· 1 + import ./make-test-python.nix { 2 + name = "blocky"; 3 + 4 + nodes = { 5 + server = { pkgs, ... }: { 6 + environment.systemPackages = [ pkgs.dnsutils ]; 7 + services.blocky = { 8 + enable = true; 9 + 10 + settings = { 11 + customDNS = { 12 + mapping = { 13 + "printer.lan" = "192.168.178.3,2001:0db8:85a3:08d3:1319:8a2e:0370:7344"; 14 + }; 15 + }; 16 + upstream = { 17 + default = [ "8.8.8.8" "1.1.1.1" ]; 18 + }; 19 + port = 53; 20 + httpPort = 5000; 21 + logLevel = "info"; 22 + }; 23 + }; 24 + }; 25 + }; 26 + 27 + testScript = '' 28 + with subtest("Service test"): 29 + server.wait_for_unit("blocky.service") 30 + server.wait_for_open_port(53) 31 + server.wait_for_open_port(5000) 32 + server.succeed("dig @127.0.0.1 +short -x 192.168.178.3 | grep -qF printer.lan") 33 + ''; 34 + }
+3
pkgs/applications/networking/blocky/default.nix
··· 1 1 { buildGoModule 2 2 , fetchFromGitHub 3 3 , lib 4 + , nixosTests 4 5 }: 5 6 6 7 buildGoModule rec { ··· 27 28 license = licenses.asl20; 28 29 maintainers = with maintainers; [ ratsclub ]; 29 30 }; 31 + 32 + passthru.tests = { inherit (nixosTests) blocky; }; 30 33 }