···238238 <link xlink:href="options.html#opt-services.headscale.enable">services.headscale</link>
239239 </para>
240240 </listitem>
241241+ <listitem>
242242+ <para>
243243+ <link xlink:href="https://0xerr0r.github.io/blocky/">blocky</link>,
244244+ fast and lightweight DNS proxy as ad-blocker for local network
245245+ with many features.
246246+ </para>
247247+ </listitem>
241248 </itemizedlist>
242249 </section>
243250 <section xml:id="sec-release-22.05-incompatibilities">
+2
nixos/doc/manual/release-notes/rl-2205.section.md
···71717272- [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)
73737474+- [blocky](https://0xerr0r.github.io/blocky/), fast and lightweight DNS proxy as ad-blocker for local network with many features.
7575+7476<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
75777678## Backward Incompatibilities {#sec-release-22.05-incompatibilities}
···3939 default = "127.0.0.1";
4040 description = ''
4141 The host name or IP address on which to bind Airsonic.
4242- Only relevant if you have multiple network interfaces and want
4343- to make Airsonic available on only one of them. The default value
4444- will bind Airsonic to all available network interfaces.
4242+ The default value is appropriate for first launch, when the
4343+ default credentials are easy to guess. It is also appropriate
4444+ if you intend to use the virtualhost option in the service
4545+ module. In other cases, you may want to change this to a
4646+ specific IP or 0.0.0.0 to listen on all interfaces.
4547 '';
4648 };
4749
+40
nixos/modules/services/networking/blocky.nix
···11+{ config, lib, pkgs, ... }:
22+33+with lib;
44+55+let
66+ cfg = config.services.blocky;
77+88+ format = pkgs.formats.yaml { };
99+ configFile = format.generate "config.yaml" cfg.settings;
1010+in
1111+{
1212+ options.services.blocky = {
1313+ enable = mkEnableOption "Fast and lightweight DNS proxy as ad-blocker for local network with many features";
1414+1515+ settings = mkOption {
1616+ type = format.type;
1717+ default = { };
1818+ description = ''
1919+ Blocky configuration. Refer to
2020+ <link xlink:href="https://0xerr0r.github.io/blocky/configuration/"/>
2121+ for details on supported values.
2222+ '';
2323+ };
2424+ };
2525+2626+ config = mkIf cfg.enable {
2727+ systemd.services.blocky = {
2828+ description = "A DNS proxy and ad-blocker for the local network";
2929+ wantedBy = [ "multi-user.target" ];
3030+3131+ serviceConfig = {
3232+ DynamicUser = true;
3333+ ExecStart = "${pkgs.blocky}/bin/blocky --config ${configFile}";
3434+3535+ AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
3636+ CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ];
3737+ };
3838+ };
3939+ };
4040+}
···7878 # fail to detect its variant at runtime.
7979 # See: https://github.com/NixOS/nixpkgs/issues/114993#issuecomment-812951247
8080 ./force-cs-variant.patch
8181+8282+ # The entry point binary $out/bin/racket is codesigned at least once. The
8383+ # following error is triggered as a result.
8484+ # (error 'add-ad-hoc-signature "file already has a signature")
8585+ # We always remove the existing signature then call add-ad-hoc-signature to
8686+ # circumvent this error.
8787+ ./force-remove-codesign-then-add.patch
8188 ];
82898390 preConfigure = ''
···9097 --replace /bin/rm ${coreutils}/bin/rm \
9198 --replace /bin/true ${coreutils}/bin/true
9299 done
100100+101101+ # The configure script forces using `libtool -o` as AR on Darwin. But, the
102102+ # `-o` option is only available from Apple libtool. GNU ar works here.
103103+ substituteInPlace src/ChezScheme/zlib/configure \
104104+ --replace 'ARFLAGS="-o"' 'AR=ar; ARFLAGS="rc"'
105105+93106 mkdir src/build
94107 cd src/build
951089696- gappsWrapperArgs+=("--prefix" "LD_LIBRARY_PATH" ":" ${LD_LIBRARY_PATH})
109109+ '' + lib.optionalString stdenv.isLinux ''
110110+ gappsWrapperArgs+=("--prefix" "LD_LIBRARY_PATH" ":" ${libPath})
111111+ '' + lib.optionalString stdenv.isDarwin ''
112112+ gappsWrapperArgs+=("--prefix" "DYLD_LIBRARY_PATH" ":" ${libPath})
113113+ ''
114114+ ;
115115+116116+ preBuild = lib.optionalString stdenv.isDarwin ''
117117+ # Cannot set DYLD_LIBRARY_PATH as an attr of this drv, becasue dynamic
118118+ # linker environment variables like this are purged.
119119+ # See: https://apple.stackexchange.com/a/212954/167199
120120+121121+ # Make builders feed it to dlopen(...). Do not expose all of $libPath to
122122+ # DYLD_LIBRARY_PATH as the order of looking up symbols like
123123+ # `__cg_jpeg_resync_to_restart` will be messed up. Our libJPEG.dyllib
124124+ # expects it from our libTIFF.dylib, but instead it could not be found from
125125+ # the system `libTIFF.dylib`. DYLD_FALLBACK_LIBRARY_PATH has its own problem
126126+ # , too.
127127+ export DYLD_FALLBACK_LIBRARY_PATH="${libPath}"
97128 '';
9812999130 shared = if stdenv.isDarwin then "dylib" else "shared";
···119150 homepage = "https://racket-lang.org/";
120151 license = with licenses; [ asl20 /* or */ mit ];
121152 maintainers = with maintainers; [ kkallio henrytill vrthra ];
122122- platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux" ];
153153+ platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
123154 };
124155}
···1414 as well as libraries that live in collections. In particular, raco
1515 and the pkg library are still bundled.
1616 '';
1717- platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
1717+ platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
1818 broken = false; # Minimal build does not require working FFI
1919 };
2020})
···304304 meta = apparmor-meta "kernel patches";
305305 };
306306307307- # Generate generic AppArmor rules in a file,
308308- # from the closure of given rootPaths.
309309- # To be included in an AppArmor profile like so:
310310- # include "$(apparmorRulesFromClosure {} [pkgs.hello]}"
307307+ # Generate generic AppArmor rules in a file, from the closure of given
308308+ # rootPaths. To be included in an AppArmor profile like so:
309309+ #
310310+ # include "${apparmorRulesFromClosure { } [ pkgs.hello ]}"
311311 apparmorRulesFromClosure =
312312 { # The store path of the derivation is given in $path
313313 additionalRules ? []