···1010>>>
1111```
12121313+::: {.note}
1414+By executing the test driver in this way,
1515+the VMs executed may gain network & Internet access via their backdoor control interface,
1616+typically recognized as `eth0`.
1717+:::
1818+1319You can then take any Python statement, e.g.
14201521```py
+2
nixos/doc/manual/release-notes/rl-2505.section.md
···47474848- [waagent](https://github.com/Azure/WALinuxAgent), the Microsoft Azure Linux Agent (waagent) manages Linux provisioning and VM interaction with the Azure Fabric Controller. Available with [services.waagent](options.html#opt-services.waagent.enable).
49495050+- [nostr-rs-relay](https://git.sr.ht/~gheartsfield/nostr-rs-relay/), This is a nostr relay, written in Rust. Available as [services.nostr-rs-relay](options.html#opt-services.nostr-rs-relay.enable).
5151+5052- [mqtt-exporter](https://github.com/kpetremann/mqtt-exporter/), a Prometheus exporter for exposing messages from MQTT. Available as [services.prometheus.exporters.mqtt](#opt-services.prometheus.exporters.mqtt.enable).
51535254- [Buffyboard](https://gitlab.postmarketos.org/postmarketOS/buffybox/-/tree/master/buffyboard), a framebuffer on-screen keyboard. Available as [services.buffyboard](option.html#opt-services.buffyboard).
···162162 '';
163163164164 compressFirmware = firmware:
165165- let
166166- inherit (config.boot.kernelPackages) kernelAtLeast;
167167- in
168168- if ! (firmware.compressFirmware or true) then
169169- firmware
170170- else
171171- if kernelAtLeast "5.19" then pkgs.compressFirmwareZstd firmware
172172- else if kernelAtLeast "5.3" then pkgs.compressFirmwareXz firmware
173173- else firmware;
165165+ if config.hardware.firmwareCompression == "none" || (firmware.compressFirmware or false) == false then firmware
166166+ else if config.hardware.firmwareCompression == "zstd" then pkgs.compressFirmwareZstd firmware
167167+ else pkgs.compressFirmwareXz firmware;
174168175169 # Udev has a 512-character limit for ENV{PATH}, so create a symlink
176170 # tree to work around this.
···279273 };
280274 };
281275276276+ hardware.firmwareCompression = lib.mkOption {
277277+ type = lib.types.enum [ "xz" "zstd" "none" ];
278278+ default = if config.boot.kernelPackages.kernelAtLeast "5.19" then "zstd"
279279+ else if config.boot.kernelPackages.kernelAtLeast "5.3" then "xz"
280280+ else "none";
281281+ defaultText = "auto";
282282+ description = ''
283283+ Whether to compress firmware files.
284284+ Defaults depend on the kernel version.
285285+ For kernels older than 5.3, firmware files are not compressed.
286286+ For kernels 5.3 and newer, firmware files are compressed with xz.
287287+ For kernels 5.19 and newer, firmware files are compressed with zstd.
288288+ '';
289289+ };
290290+282291 networking.usePredictableInterfaceNames = lib.mkOption {
283292 default = true;
284293 type = lib.types.bool;
···345354 ###### implementation
346355347356 config = lib.mkIf cfg.enable {
357357+358358+ assertions = [
359359+ {
360360+ assertion = config.hardware.firmwareCompression == "zstd" -> config.boot.kernelPackages.kernelAtLeast "5.19";
361361+ message = ''
362362+ The firmware compression method is set to zstd, but the kernel version is too old.
363363+ The kernel version must be at least 5.3 to use zstd compression.
364364+ '';
365365+ }
366366+ {
367367+ assertion = config.hardware.firmwareCompression == "xz" -> config.boot.kernelPackages.kernelAtLeast "5.3";
368368+ message = ''
369369+ The firmware compression method is set to xz, but the kernel version is too old.
370370+ The kernel version must be at least 5.3 to use xz compression.
371371+ '';
372372+ }
373373+ ];
348374349375 services.udev.extraRules = nixosRules;
350376
+1-4
nixos/modules/services/misc/paperless.nix
···7070 ProtectKernelModules = true;
7171 ProtectKernelTunables = true;
7272 ProtectProc = "invisible";
7373- # Don't restrict ProcSubset because django-q requires read access to /proc/stat
7474- # to query CPU and memory information.
7575- # Note that /proc only contains processes of user `paperless`, so this is safe.
7676- # ProcSubset = "pid";
7373+ ProcSubset = "pid";
7774 RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
7875 RestrictNamespaces = true;
7976 RestrictRealtime = true;
+18-5
nixos/modules/services/networking/hickory-dns.nix
···33 cfg = config.services.hickory-dns;
44 toml = pkgs.formats.toml { };
5566- configFile = toml.generate "hickory-dns.toml" (
77- lib.filterAttrsRecursive (_: v: v != null) cfg.settings
88- );
99-106 zoneType = lib.types.submodule ({ config, ... }: {
77+ freeformType = toml.type;
118 options = with lib; {
129 zone = mkOption {
1310 type = types.str;
···8279 If neither `quiet` nor `debug` are enabled, logging defaults to the INFO level.
8380 '';
8481 };
8282+ configFile = mkOption {
8383+ type = types.path;
8484+ default = toml.generate "hickory-dns.toml" (
8585+ lib.filterAttrsRecursive (_: v: v != null) cfg.settings
8686+ );
8787+ defaultText = lib.literalExpression ''
8888+ let toml = pkgs.formats.toml { }; in toml.generate "hickory-dns.toml" cfg.settings
8989+ '';
9090+ description = ''
9191+ Path to an existing toml file to configure hickory-dns with.
9292+9393+ This can usually be left unspecified, in which case it will be
9494+ generated from the values in `settings`.
9595+ If manually specified, then the options in `settings` are ignored.
9696+ '';
9797+ };
8598 settings = mkOption {
8699 description = ''
87100 Settings for hickory-dns. The options enumerated here are not exhaustive.
···142155 flags = (lib.optional cfg.debug "--debug") ++ (lib.optional cfg.quiet "--quiet");
143156 flagsStr = builtins.concatStringsSep " " flags;
144157 in ''
145145- ${lib.getExe cfg.package} --config ${configFile} ${flagsStr}
158158+ ${lib.getExe cfg.package} --config ${cfg.configFile} ${flagsStr}
146159 '';
147160 Type = "simple";
148161 Restart = "on-failure";
···3939 # on NixOS because the timestamp never changes. As a workaround, delete the
4040 # icon cache at login and session activation.
4141 # See also: http://lists-archives.org/kde-devel/26175-what-when-will-icon-cache-refresh.html
4242- rm -fv $HOME/.cache/icon-cache.kcache
4242+ rm -fv "$HOME"/.cache/icon-cache.kcache
43434444 # xdg-desktop-settings generates this empty file but
4545 # it makes kbuildsyscoca5 fail silently. To fix this
4646 # remove that menu if it exists.
4747- rm -fv ''${XDG_CONFIG_HOME}/menus/applications-merged/xdg-desktop-menu-dummy.menu
4747+ rm -fv "''${XDG_CONFIG_HOME}"/menus/applications-merged/xdg-desktop-menu-dummy.menu
48484949 # Qt writes a weird ‘libraryPath’ line to
5050 # ~/.config/Trolltech.conf that causes the KDE plugin
···6161 # Remove the kbuildsyscoca5 cache. It will be regenerated
6262 # immediately after. This is necessary for kbuildsyscoca5 to
6363 # recognize that software that has been removed.
6464- rm -fv $HOME/.cache/ksycoca*
6464+ rm -fv "$HOME"/.cache/ksycoca*
65656666 ${pkgs.plasma5Packages.kservice}/bin/kbuildsycoca5
6767 '';
···260260 ''
261261 else ''
262262 rm -f /usr/bin/env
263263- rmdir --ignore-fail-on-non-empty /usr/bin /usr
263263+ if test -d /usr/bin; then rmdir --ignore-fail-on-non-empty /usr/bin; fi
264264+ if test -d /usr; then rmdir --ignore-fail-on-non-empty /usr; fi
264265 '';
265266266267 system.activationScripts.specialfs =
···11+{
22+ lib,
33+ buildDotnetModule,
44+ cctools,
55+ darwin,
66+ dotnetCorePackages,
77+ fetchFromGitHub,
88+ libX11,
99+ libgdiplus,
1010+ moltenvk,
1111+ ffmpeg,
1212+ openal,
1313+ libsoundio,
1414+ sndio,
1515+ stdenv,
1616+ pulseaudio,
1717+ vulkan-loader,
1818+ glew,
1919+ libGL,
2020+ libICE,
2121+ libSM,
2222+ libXcursor,
2323+ libXext,
2424+ libXi,
2525+ libXrandr,
2626+ udev,
2727+ SDL2,
2828+ SDL2_mixer,
2929+}:
3030+3131+buildDotnetModule rec {
3232+ pname = "ryujinx-greemdev";
3333+ version = "1.2.76";
3434+3535+ src = fetchFromGitHub {
3636+ owner = "GreemDev";
3737+ repo = "Ryujinx";
3838+ rev = version;
3939+ hash = "sha256-RQbFN+XMEZtouUB7cvO3OdanUm6Is9V2L6q7dqzGQY4=";
4040+ };
4141+4242+ nativeBuildInputs = lib.optional stdenv.isDarwin [
4343+ cctools
4444+ darwin.sigtool
4545+ ];
4646+4747+ enableParallelBuilding = false;
4848+4949+ dotnet-sdk = dotnetCorePackages.sdk_8_0;
5050+ dotnet-runtime = dotnetCorePackages.runtime_8_0;
5151+5252+ nugetDeps = ./deps.nix;
5353+5454+ runtimeDeps =
5555+ [
5656+ libX11
5757+ libgdiplus
5858+ SDL2_mixer
5959+ openal
6060+ libsoundio
6161+ sndio
6262+ vulkan-loader
6363+ ffmpeg
6464+6565+ # Avalonia UI
6666+ glew
6767+ libICE
6868+ libSM
6969+ libXcursor
7070+ libXext
7171+ libXi
7272+ libXrandr
7373+7474+ # Headless executable
7575+ libGL
7676+ SDL2
7777+ ]
7878+ ++ lib.optional (!stdenv.isDarwin) [
7979+ udev
8080+ pulseaudio
8181+ ]
8282+ ++ lib.optional stdenv.isDarwin [ moltenvk ];
8383+8484+ projectFile = "Ryujinx.sln";
8585+ testProjectFile = "src/Ryujinx.Tests/Ryujinx.Tests.csproj";
8686+8787+ # Tests on Darwin currently fail because of Ryujinx.Tests.Unicorn
8888+ doCheck = !stdenv.isDarwin;
8989+9090+ dotnetFlags = [
9191+ "/p:ExtraDefineConstants=DISABLE_UPDATER%2CFORCE_EXTERNAL_BASE_DIR"
9292+ ];
9393+9494+ executables = [
9595+ "Ryujinx.Headless.SDL2"
9696+ "Ryujinx"
9797+ ];
9898+9999+ makeWrapperArgs = [
100100+ # Without this Ryujinx fails to start on wayland. See https://github.com/Ryujinx/Ryujinx/issues/2714
101101+ "--set SDL_VIDEODRIVER x11"
102102+ ];
103103+104104+ preInstall = ''
105105+ # workaround for https://github.com/Ryujinx/Ryujinx/issues/2349
106106+ mkdir -p $out/lib/sndio-6
107107+ ln -s ${sndio}/lib/libsndio.so $out/lib/sndio-6/libsndio.so.6
108108+ '';
109109+110110+ preFixup = ''
111111+ ${lib.optionalString stdenv.isLinux ''
112112+ mkdir -p $out/share/{applications,icons/hicolor/scalable/apps,mime/packages}
113113+114114+ pushd ${src}/distribution/linux
115115+116116+ install -D ./Ryujinx.desktop $out/share/applications/Ryujinx.desktop
117117+ install -D ./Ryujinx.sh $out/bin/Ryujinx.sh
118118+ install -D ./mime/Ryujinx.xml $out/share/mime/packages/Ryujinx.xml
119119+ install -D ../misc/Logo.svg $out/share/icons/hicolor/scalable/apps/Ryujinx.svg
120120+121121+ popd
122122+ ''}
123123+124124+ # Don't make a softlink on OSX because of its case insensitivity
125125+ ${lib.optionalString (!stdenv.isDarwin) "ln -s $out/bin/Ryujinx $out/bin/ryujinx"}
126126+ '';
127127+128128+ passthru.updateScript = ./updater.sh;
129129+130130+ meta = with lib; {
131131+ homepage = "https://github.com/GreemDev/Ryujinx";
132132+ changelog = "https://github.com/GreemDev/Ryujinx/wiki/Changelog";
133133+ description = "Experimental Nintendo Switch Emulator written in C# (QoL fork)";
134134+ longDescription = ''
135135+ Ryujinx is an open-source Nintendo Switch emulator, created by gdkchan,
136136+ written in C#. This emulator aims at providing excellent accuracy and
137137+ performance, a user-friendly interface and consistent builds. It was
138138+ written from scratch and development on the project began in September
139139+ 2017. The project has since been abandoned on October 1st 2024 and QoL
140140+ updates are now managed under a fork.
141141+ '';
142142+ license = licenses.mit;
143143+ maintainers = with maintainers; [
144144+ jk
145145+ artemist
146146+ kekschen
147147+ ];
148148+ platforms = [
149149+ "x86_64-linux"
150150+ "aarch64-linux"
151151+ "aarch64-darwin"
152152+ ];
153153+ mainProgram = "Ryujinx";
154154+ };
155155+}
+57
pkgs/by-name/ry/ryujinx-greemdev/updater.sh
···11+#! /usr/bin/env nix-shell
22+#! nix-shell -I nixpkgs=./. -i bash -p coreutils gnused curl common-updater-scripts nix-prefetch-git jq
33+# shellcheck shell=bash
44+set -euo pipefail
55+cd "$(dirname "${BASH_SOURCE[0]}")"
66+77+# provide a github token so you don't get rate limited
88+# if you use gh cli you can use:
99+# `export GITHUB_TOKEN="$(cat ~/.config/gh/config.yml | yq '.hosts."github.com".oauth_token' -r)"`
1010+# or just set your token by hand:
1111+# `read -s -p "Enter your token: " GITHUB_TOKEN; export GITHUB_TOKEN`
1212+# (we use read so it doesn't show in our shell history and in secret mode so the token you paste isn't visible)
1313+if [ -z "${GITHUB_TOKEN:-}" ]; then
1414+ echo "no GITHUB_TOKEN provided - you could meet API request limiting" >&2
1515+fi
1616+1717+# or provide the new version manually
1818+# manually modify and uncomment or export these env vars in your shell so they're accessable within the script
1919+# make sure you don't commit your changes here
2020+#
2121+# NEW_VERSION=""
2222+# COMMIT=""
2323+2424+if [ -z ${NEW_VERSION+x} ] && [ -z ${COMMIT+x} ]; then
2525+ RELEASE_DATA=$(
2626+ curl -s -H "Accept: application/vnd.github.v3+json" \
2727+ ${GITHUB_TOKEN:+ -H "Authorization: bearer $GITHUB_TOKEN"} \
2828+ https://api.github.com/repos/GreemDev/Ryujinx/releases
2929+ )
3030+ if [ -z "$RELEASE_DATA" ] || [[ $RELEASE_DATA =~ "rate limit exceeded" ]]; then
3131+ echo "failed to get release job data" >&2
3232+ exit 1
3333+ fi
3434+ NEW_VERSION=$(echo "$RELEASE_DATA" | jq -r '.[0].name')
3535+fi
3636+3737+OLD_VERSION="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./package.nix)"
3838+3939+echo "comparing versions $OLD_VERSION -> $NEW_VERSION"
4040+if [[ "$OLD_VERSION" == "$NEW_VERSION" ]]; then
4141+ echo "Already up to date!"
4242+ if [[ "${1-default}" != "--deps-only" ]]; then
4343+ exit 0
4444+ fi
4545+fi
4646+4747+cd ../../../..
4848+4949+if [[ "${1-default}" != "--deps-only" ]]; then
5050+ SHA="$(nix-prefetch-git https://github.com/GreemDev/Ryujinx --rev "$NEW_VERSION" --quiet | jq -r '.sha256')"
5151+ SRI=$(nix --experimental-features nix-command hash to-sri "sha256:$SHA")
5252+ update-source-version ryujinx-greemdev "$NEW_VERSION" "$SRI"
5353+fi
5454+5555+echo "building Nuget lockfile"
5656+5757+eval "$(nix-build -A ryujinx-greemdev.fetch-deps --no-out-link)"