···238 <link xlink:href="options.html#opt-services.headscale.enable">services.headscale</link>
239 </para>
240 </listitem>
241+ <listitem>
242+ <para>
243+ <link xlink:href="https://0xerr0r.github.io/blocky/">blocky</link>,
244+ fast and lightweight DNS proxy as ad-blocker for local network
245+ with many features.
246+ </para>
247+ </listitem>
248 </itemizedlist>
249 </section>
250 <section xml:id="sec-release-22.05-incompatibilities">
+2
nixos/doc/manual/release-notes/rl-2205.section.md
···7172- [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)
730074<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
7576## Backward Incompatibilities {#sec-release-22.05-incompatibilities}
···7172- [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)
7374+- [blocky](https://0xerr0r.github.io/blocky/), fast and lightweight DNS proxy as ad-blocker for local network with many features.
75+76<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
7778## Backward Incompatibilities {#sec-release-22.05-incompatibilities}
···39 default = "127.0.0.1";
40 description = ''
41 The host name or IP address on which to bind Airsonic.
42- Only relevant if you have multiple network interfaces and want
43- to make Airsonic available on only one of them. The default value
44- will bind Airsonic to all available network interfaces.
0045 '';
46 };
47
···39 default = "127.0.0.1";
40 description = ''
41 The host name or IP address on which to bind Airsonic.
42+ The default value is appropriate for first launch, when the
43+ default credentials are easy to guess. It is also appropriate
44+ if you intend to use the virtualhost option in the service
45+ module. In other cases, you may want to change this to a
46+ specific IP or 0.0.0.0 to listen on all interfaces.
47 '';
48 };
49
+40
nixos/modules/services/networking/blocky.nix
···0000000000000000000000000000000000000000
···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+}
···78 # fail to detect its variant at runtime.
79 # See: https://github.com/NixOS/nixpkgs/issues/114993#issuecomment-812951247
80 ./force-cs-variant.patch
000000081 ];
8283 preConfigure = ''
···90 --replace /bin/rm ${coreutils}/bin/rm \
91 --replace /bin/true ${coreutils}/bin/true
92 done
00000093 mkdir src/build
94 cd src/build
9596- gappsWrapperArgs+=("--prefix" "LD_LIBRARY_PATH" ":" ${LD_LIBRARY_PATH})
00000000000000000097 '';
9899 shared = if stdenv.isDarwin then "dylib" else "shared";
···119 homepage = "https://racket-lang.org/";
120 license = with licenses; [ asl20 /* or */ mit ];
121 maintainers = with maintainers; [ kkallio henrytill vrthra ];
122- platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux" ];
123 };
124}
···78 # fail to detect its variant at runtime.
79 # See: https://github.com/NixOS/nixpkgs/issues/114993#issuecomment-812951247
80 ./force-cs-variant.patch
81+82+ # The entry point binary $out/bin/racket is codesigned at least once. The
83+ # following error is triggered as a result.
84+ # (error 'add-ad-hoc-signature "file already has a signature")
85+ # We always remove the existing signature then call add-ad-hoc-signature to
86+ # circumvent this error.
87+ ./force-remove-codesign-then-add.patch
88 ];
8990 preConfigure = ''
···97 --replace /bin/rm ${coreutils}/bin/rm \
98 --replace /bin/true ${coreutils}/bin/true
99 done
100+101+ # The configure script forces using `libtool -o` as AR on Darwin. But, the
102+ # `-o` option is only available from Apple libtool. GNU ar works here.
103+ substituteInPlace src/ChezScheme/zlib/configure \
104+ --replace 'ARFLAGS="-o"' 'AR=ar; ARFLAGS="rc"'
105+106 mkdir src/build
107 cd src/build
108109+ '' + lib.optionalString stdenv.isLinux ''
110+ gappsWrapperArgs+=("--prefix" "LD_LIBRARY_PATH" ":" ${libPath})
111+ '' + lib.optionalString stdenv.isDarwin ''
112+ gappsWrapperArgs+=("--prefix" "DYLD_LIBRARY_PATH" ":" ${libPath})
113+ ''
114+ ;
115+116+ preBuild = lib.optionalString stdenv.isDarwin ''
117+ # Cannot set DYLD_LIBRARY_PATH as an attr of this drv, becasue dynamic
118+ # linker environment variables like this are purged.
119+ # See: https://apple.stackexchange.com/a/212954/167199
120+121+ # Make builders feed it to dlopen(...). Do not expose all of $libPath to
122+ # DYLD_LIBRARY_PATH as the order of looking up symbols like
123+ # `__cg_jpeg_resync_to_restart` will be messed up. Our libJPEG.dyllib
124+ # expects it from our libTIFF.dylib, but instead it could not be found from
125+ # the system `libTIFF.dylib`. DYLD_FALLBACK_LIBRARY_PATH has its own problem
126+ # , too.
127+ export DYLD_FALLBACK_LIBRARY_PATH="${libPath}"
128 '';
129130 shared = if stdenv.isDarwin then "dylib" else "shared";
···150 homepage = "https://racket-lang.org/";
151 license = with licenses; [ asl20 /* or */ mit ];
152 maintainers = with maintainers; [ kkallio henrytill vrthra ];
153+ platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
154 };
155}
···14 as well as libraries that live in collections. In particular, raco
15 and the pkg library are still bundled.
16 '';
17- platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
18 broken = false; # Minimal build does not require working FFI
19 };
20})
···14 as well as libraries that live in collections. In particular, raco
15 and the pkg library are still bundled.
16 '';
17+ platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
18 broken = false; # Minimal build does not require working FFI
19 };
20})
···304 meta = apparmor-meta "kernel patches";
305 };
306307- # Generate generic AppArmor rules in a file,
308- # from the closure of given rootPaths.
309- # To be included in an AppArmor profile like so:
310- # include "$(apparmorRulesFromClosure {} [pkgs.hello]}"
311 apparmorRulesFromClosure =
312 { # The store path of the derivation is given in $path
313 additionalRules ? []
···304 meta = apparmor-meta "kernel patches";
305 };
306307+ # Generate generic AppArmor rules in a file, from the closure of given
308+ # rootPaths. To be included in an AppArmor profile like so:
309+ #
310+ # include "${apparmorRulesFromClosure { } [ pkgs.hello ]}"
311 apparmorRulesFromClosure =
312 { # The store path of the derivation is given in $path
313 additionalRules ? []