### Example Snapper Configuration Source: https://nixos.org/manual/nixos/stable/release-notes This snippet shows an example configuration for the Snapper service, demonstrating how to set subvolumes and allowed users. ```nix { services.snapper.configs.example = { SUBVOLUME = "/example"; ALLOW_USERS = [ "alice" ]; }; } ``` -------------------------------- ### Snapper Configuration Migration Example Source: https://nixos.org/manual/nixos/stable/release-notes Example of migrating Snapper configuration attributes from the old format to the new one. ```nix { services.snapper.configs.example = { subvolume = "/example"; ``` -------------------------------- ### Install Azure CLI with Extensions Source: https://nixos.org/manual/nixos/stable/release-notes Use this snippet to install the Azure CLI with specific extensions, such as `aks-preview`. The configuration files are moved into the derivation by default to ensure immutability. ```nix { environment.systemPackages = [ (azure-cli.withExtensions [ azure-cli.extensions.aks-preview ]) ]; } ``` -------------------------------- ### Gauge Plugin Installation with Nix Source: https://nixos.org/manual/nixos/stable/release-notes Install Gauge plugins directly using Nix. For imperative installation, use `gauge-unwrapped`. ```nix gauge.fromManifest ./path/to/manifest.json ``` ```nix gauge.withPlugins (p: with p; [ js html-report xml-report ]) ``` -------------------------------- ### Install nixos-rebuild-ng alongside nixos-rebuild Source: https://nixos.org/manual/nixos/stable/release-notes Install `nixos-rebuild-ng` as a separate package by adding it to `environment.systemPackages`. It will be available as `nixos-rebuild-ng`. ```nix environment.systemPackages = [ pkgs.nixos-rebuild-ng ]; ``` -------------------------------- ### Configure Nextcloud Package Source: https://nixos.org/manual/nixos/stable/release-notes Explicitly set the Nextcloud package to be installed. This is the recommended approach. ```nix services.nextcloud.package = pkgs.nextcloud33; ``` -------------------------------- ### Enable LXQt Desktop Environment with Qt 6 and Wayland Support Source: https://nixos.org/manual/nixos/stable/release-notes Install LXQt 2.0, which is based on Qt 6 and offers Wayland support for many applications. ```nix services.desktopManager.lxqt.enable = true; ``` -------------------------------- ### Configure MATE Extra Panel Applets Source: https://nixos.org/manual/nixos/stable/release-notes Use this option to install panel applets for the MATE desktop environment, especially for those built with Wayland support. ```nix services.xserver.desktopManager.mate.extraPanelApplets ``` -------------------------------- ### Build Caddy with Plugins Source: https://nixos.org/manual/nixos/stable/release-notes Use `caddy.withPlugins` to build Caddy with custom plugins. Omit the `hash` argument to get the correct value if the build fails. Ensure all plugins have versions or tags. ```nix let pkgs = import { }; in pkgs.caddy.withPlugins { plugins = [ # tagged upstream "github.com/caddy-dns/powerdns@v1.0.1" # pseudo-version number generated by Go "github.com/caddy-dns/cloudflare@v0.0.0-20240703190432-89f16b99c18e" "github.com/mholt/caddy-webdav@v0.0.0-20241008162340-42168ba04c9d" ]; hash = "sha256-wqXSd1Ep9TVpQi570TTb96LwzNYvWL5EBJXMJfYWCAk="; } ``` -------------------------------- ### Install GNOME Session Path Extensions Source: https://nixos.org/manual/nixos/stable/release-notes Install the `gnome-shell-extensions` collection, which includes GNOME Classic extensions, Apps Menu, and User Themes, by setting `services.xserver.desktopManager.gnome.sessionPath`. These were not installed by default in this release. ```nix services.xserver.desktopManager.gnome.sessionPath ``` -------------------------------- ### Enable Plasma 6 Desktop Environment Source: https://nixos.org/manual/nixos/stable/release-notes Install Plasma 6, which runs as Wayland by default. The X11 session can be explicitly selected if needed. Plasma 5 is expected to be deprecated in the next release. ```nix services.desktopManager.plasma6.enable = true; ``` -------------------------------- ### Migrate Signald Database Source: https://nixos.org/manual/nixos/stable/release-notes Use this command to migrate the Signald database before starting the Signald service. Ensure the paths are correct for your installation. ```bash signald -d /var/lib/signald/db \ --database sqlite:/var/lib/signald/db \ --migrate-data ``` -------------------------------- ### Configure sudo-rs with Extra Rules Source: https://nixos.org/manual/nixos/stable/release-notes When using the sudo-rs module, previously set rules are not automatically used. This example shows how to migrate existing sudo rules to sudo-rs. ```nix security.sudo-rs.extraRules = security.sudo.extraRules; ``` -------------------------------- ### Enable Lomiri Desktop Manager in NixOS Source: https://nixos.org/manual/nixos/stable/release-notes Install the Lomiri desktop environment, which uses Mir 2.x as a Wayland compositor. Note that some core applications and services may still be incomplete. ```nix services.desktopManager.lomiri.enable = true; ``` -------------------------------- ### Configure MATE Extra Caja Extensions Source: https://nixos.org/manual/nixos/stable/release-notes Use this option to install Caja extensions for the MATE desktop environment. ```nix services.xserver.desktopManager.mate.extraCajaExtensions ``` -------------------------------- ### SSHFS Mount with Unsupported Option Source: https://nixos.org/manual/nixos/stable/release-notes Demonstrates an example of using `sshfs` with an unsupported mount option (`atime`). Previously, this would succeed silently; now, it results in an error and non-zero exit status due to stricter validation in `fuse3`. ```bash $ sshfs 127.0.0.1:/home/test/testdir /home/test/sshfs_mnt -o atime ``` -------------------------------- ### Stargazer Hardening and CGI Support Source: https://nixos.org/manual/nixos/stable/release-notes The `services.stargazer` service has been hardened for security. The new `services.stargazer.allowCgiUser` option enables traditional CGI setups. ```nix services.stargazer.allowCgiUser ``` -------------------------------- ### Configure GitHub Runner Service Overrides Source: https://nixos.org/manual/nixos/stable/release-notes Example of how to override systemd service configuration for GitHub runners using the `serviceOverrides` option. This is necessary if you were previously overriding `systemd.services.github-runner.serviceConfig`. ```nix { services.github-runner.serviceOverrides.SupplementaryGroups = [ "docker" ]; } ``` -------------------------------- ### Configure Random Encryption for Swap Devices Source: https://nixos.org/manual/nixos/stable/release-notes Control sector size, cipher, and key size for NixOS swap partitions with random encryption. This allows for more granular control over the encryption setup compared to default cryptsetup behavior. ```nix { swapDevices = [ { device = "/dev/disk/by-partlabel/swapspace"; randomEncryption = { enable = true; cipher = "aes-xts-plain64"; keySize = 512; sectorSize = 4096; }; } ]; } ``` -------------------------------- ### Ensure Network Connectivity for System Services Source: https://nixos.org/manual/nixos/stable/release-notes System services that require network connectivity to start correctly must now explicitly declare their dependency on 'network-online.target'. This change prevents unnecessary delays in user logins. ```nix { systemd.services. = { wants = [ "network-online.target" ]; after = [ "network-online.target" ]; }; } ``` -------------------------------- ### Disable Deferred Native Compilation in Emacs Source: https://nixos.org/manual/nixos/stable/release-notes If you do not want asynchronous deferred native compilation for Emacs packages installed outside of Nixpkgs, use `(setq native-comp-deferred-compilation nil)`. ```emacs-lisp (setq native-comp-deferred-compilation nil) ``` -------------------------------- ### Using system.nix as an Alternative Entry Point Source: https://nixos.org/manual/nixos/stable/release-notes This snippet demonstrates how to use `system.nix` as an alternative entry point to NixOS configuration without relying on `nix-channel`. It shows how to fetch a specific Nixpkgs archive and import it for building NixOS. ```nix let # Pinned Nixpkgs archive # # Use `curl -I https://channels.nixos.org/nixos-26.05` to get the # latest commit of the stable channel and `nix --extra-experimental-features nix-command store prefetch-file --unpack` # to compute its hash. nixpkgs = builtins.fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/c217913993d6.tar.gz"; hash = "sha256-D1PA3xQv/s4W3lnR9yJFSld8UOLr0a/cBWMQMXS+1Qg="; }; in import "${nixpkgs}/nixos" { # Build NixOS using an external configuration.nix file, # or directly set your options here configuration = ./configuration.nix; } ``` -------------------------------- ### Import Linode Cloud Image Module Source: https://nixos.org/manual/nixos/stable/release-notes To support Linode cloud images, import `${modulesPath}/virtualisation/linode-image.nix` and access `system.build.linodeImage`. ```nix ${modulesPath}/virtualisation/linode-image.nix ``` ```nix system.build.linodeImage ``` -------------------------------- ### Enable COSMIC DE Greeter Source: https://nixos.org/manual/nixos/stable/release-notes Enable the COSMIC DE greeter by setting `services.displayManager.cosmic-greeter.enable`. This is part of the experimental support for COSMIC DE. ```nix services.displayManager.cosmic-greeter.enable ``` -------------------------------- ### Enable Saleae Logic Hardware Support Source: https://nixos.org/manual/nixos/stable/release-notes Enable hardware support for the Saleae Logic device family using `hardware.saleae-logic.enable` and specify the package with `hardware.saleae-logic.package`. ```nix hardware.saleae-logic.enable ``` ```nix hardware.saleae-logic.package ``` -------------------------------- ### Configure Media Key Bindings with actkbd Source: https://nixos.org/manual/nixos/stable/release-notes Use this snippet to configure media key bindings for volume control and mute using the `actkbd` service. Ensure `alsa-utils` is available in your environment. ```nix { services.actkbd = let volumeStep = "1%"; in { enable = true; bindings = [ # "Mute" media key { keys = [ 113 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Master toggle"; } # "Lower Volume" media key { keys = [ 114 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}- unmute"; } # "Raise Volume" media key { keys = [ 115 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}+ unmute"; } # "Mic Mute" media key { keys = [ 190 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Capture toggle"; } ]; }; } ``` -------------------------------- ### Configure Single GitHub Runner Source: https://nixos.org/manual/nixos/stable/release-notes Options under `services.github-runner` remain available for configuring a single GitHub runner. ```nix services.github-runner ``` -------------------------------- ### Copying Over Module Definitions Source: https://nixos.org/manual/nixos/stable/release-notes Use this snippet to move definitions for properties, modules, objects, SPA libraries, commands, rules, or PulseAudio commands into a drop-in configuration. ```json { "context.properties": { "your.property.name": "your.property.value" }, "context.modules": [ { "name": "libpipewire-module-my-cool-thing" } ], "context.objects": [ { "factory": { ... } } ], "alsa.rules": [ { "matches: { ... }, "actions": { ... } } ] } ``` -------------------------------- ### Enable nixos-rebuild-ng Source: https://nixos.org/manual/nixos/stable/release-notes Enable the new `nixos-rebuild-ng` tool by setting `system.rebuild.enableNg`. This will replace the old `nixos-rebuild`. ```nix system.rebuild.enableNg ``` -------------------------------- ### Enable JIT Compilation for PostgreSQL Source: https://nixos.org/manual/nixos/stable/release-notes Opt-in support for Just-In-Time (JIT) compilation in PostgreSQL. Enable this option to potentially improve query performance. ```nix { services.postgresql.enableJIT = true; } ``` -------------------------------- ### Enable MATE Wayland Session Source: https://nixos.org/manual/nixos/stable/release-notes Enable the Wayland session for the MATE desktop environment. This is an opt-in feature that requires Wayfire closures and suggests using SDDM as the display manager due to known issues with LightDM. ```nix services.xserver.desktopManager.mate.enableWaylandSession = true; ``` -------------------------------- ### Enable COSMIC DE Source: https://nixos.org/manual/nixos/stable/release-notes Enable the COSMIC DE itself by setting `services.desktopManager.cosmic.enable`. This support is stable but considered experimental. ```nix services.desktopManager.cosmic.enable ``` -------------------------------- ### Configure User Passwords with yescrypt Hash Source: https://nixos.org/manual/nixos/stable/release-notes When using `users.users..hashedPassword` to configure user passwords, run `mkpasswd` and use the provided yescrypt hash. ```nix users.users..hashedPassword ``` -------------------------------- ### Using minio_legacy_fs for Data Migration Source: https://nixos.org/manual/nixos/stable/release-notes To migrate Minio storage from the legacy filesystem backend, use the `minio_legacy_fs` package to export data before switching to the new version. ```nix services.minio.package = minio_legacy_fs; ``` -------------------------------- ### Configuring Nextcloud Upgrade Path Source: https://nixos.org/manual/nixos/stable/release-notes To upgrade Nextcloud, declare `services.nextcloud.package = pkgs.nextcloud28;` to first upgrade to an intermediate version before moving to v29. Direct upgrades between major versions are not supported. ```nix services.nextcloud.package = pkgs.nextcloud28; ``` -------------------------------- ### Julia Environment Package Addition Source: https://nixos.org/manual/nixos/stable/release-notes Use the `.withPackages` function to build Julia environments with arbitrary ecosystem packages. ```nix julia.withPackages ["Plots"] ``` -------------------------------- ### Configure Asusd with Text Configuration Source: https://nixos.org/manual/nixos/stable/release-notes When upgrading asusd to version 6, existing configurations need to be updated to use the `text` attribute for specifying configuration file contents. ```nix -services.asusd.asusdConfig = '''file contents''' +services.asusd.asusdConfig.text = '''file contents''' ``` -------------------------------- ### Configure CoreDNS with External Plugins Source: https://nixos.org/manual/nixos/stable/release-notes Enable CoreDNS and override its package to include external plugins. This requires specifying the plugin's name, repository, version, and a vendor hash. ```nix { services.coredns = { enable = true; package = pkgs.coredns.override { externalPlugins = [ { name = "fanout"; repo = "github.com/networkservicemesh/fanout"; version = "v1.9.1"; } ]; vendorHash = ""; }; }; } ``` -------------------------------- ### Override indi-full for Non-Free Drivers Source: https://nixos.org/manual/nixos/stable/release-notes Demonstrates how to create a custom collection of INDI drivers by overriding the `indi-full` package to include non-free drivers. This is an alternative to using the `indi-full-nonfree` package. ```nix pkgs.indi-with-drivers.override {extraDrivers = with pkgs.indi-3rdparty; [indi-gphoto];} ``` -------------------------------- ### Enable Automatic Root Device Formatting in Systemd Initrd Source: https://nixos.org/manual/nixos/stable/release-notes To automatically format the root device when using the systemd initrd, set `virtualisation.fileSystems."/".autoFormat = true;`. This is a workaround for changes in the `qemu-vm.nix` module. ```nix virtualisation.fileSystems."/".autoFormat = true; ``` -------------------------------- ### Import Test Utility for Auto-Formatting Root Device Source: https://nixos.org/manual/nixos/stable/release-notes For NixOS tests that relied on the removed functionality of automatically formatting the root device in the initrd, import the test utility `nixos/tests/common/auto-format-root-device.nix`. ```nix imports = [ ./common/auto-format-root-device.nix ]; ``` -------------------------------- ### Configure Declarative Trusted Substitute Servers for Guix Source: https://nixos.org/manual/nixos/stable/release-notes Declaratively manages trusted substitute servers for Guix. Instead of using `guix archive --authorize`, list authorized keys and default substitute server URLs. ```nix services.guix.substituters.authorizedKeys ``` ```nix services.guix.substituters.urls ``` -------------------------------- ### Configure Cross-Compilation Build Platform Source: https://nixos.org/manual/nixos/stable/release-notes To cross compile, set `nixpkgs.buildPlatform` to a different value than `nixpkgs.hostPlatform`. These options cover and override `nixpkgs.{system,localSystem,crossSystem}`. ```nix nixpkgs.hostPlatform ``` ```nix nixpkgs.buildPlatform ``` -------------------------------- ### Configure Portunus with Legacy libxcrypt Source: https://nixos.org/manual/nixos/stable/release-notes If upgrading to NixOS 24.05 without completing the Portunus user migration to strong password hashes, use this configuration to maintain support for weak password hashes. This involves overriding the package to use `libxcrypt-legacy`. ```nix { services.portunus.package = pkgs.portunus.override { libxcrypt = pkgs.libxcrypt-legacy; }; services.portunus.ldap.package = pkgs.openldap.override { libxcrypt = pkgs.libxcrypt-legacy; }; } ``` -------------------------------- ### Configure Qt Adwaita Style Source: https://nixos.org/manual/nixos/stable/release-notes If you still want Adwaita style for Qt applications, you can add these options to your configuration. Be aware that this may be removed in the future. ```nix { qt = { enable = true; platformTheme = "gnome"; style = "adwaita"; }; } ``` -------------------------------- ### Configure Multiple GitHub Runners Source: https://nixos.org/manual/nixos/stable/release-notes Use `services.github-runners.` to configure multiple GitHub runners. The options under `services.github-runner` are for configuring a single runner. ```nix services.github-runners. ``` -------------------------------- ### Build Platform-Specific Images Source: https://nixos.org/manual/nixos/stable/release-notes Use the `nixos-rebuild build-image` sub-command to build platform-specific disk images from NixOS configurations. This functionality is also available for `nixos-rebuild-ng`. ```bash nixos-rebuild build-image ``` -------------------------------- ### Migrate from LSH to OpenSSH Source: https://nixos.org/manual/nixos/stable/release-notes Recommends migrating from the removed `lsh` and `services.lshd` packages to `openssh` and `services.openssh`. This is due to lack of maintenance and upstream releases for `lsh`. ```nix services.openssh ``` -------------------------------- ### FetchNextcloudApp Rewrite Source: https://nixos.org/manual/nixos/stable/release-notes The `fetchNextcloudApp` function was rewritten to use `fetchurl` instead of `fetchzip`. Existing hashes are invalidated. To restore old behavior, pass `unpack = true`. ```nix fetchNextcloudApp ``` -------------------------------- ### Configure Kanidm Unix Module with SSH Integration Source: https://nixos.org/manual/nixos/stable/release-notes Enable SSH key integration for the Kanidm Unix module. This moves options under dedicated namespaces. ```nix services.kanidm.unix.sshIntegration = true; ``` -------------------------------- ### Accessing Option Declaration Positions Source: https://nixos.org/manual/nixos/stable/release-notes Demonstrates how to access the declaration positions of an option in Nixpkgs. This shows the file and line number where an option was declared. ```nix $ nix-repl -f '' [..] nix-repl> :p options.environment.systemPackages.declarationPositions [ { column = 7; file = "/nix/store/vm9zf9wvfd628cchj0hdij1g4hzjrcz9-source/nixos/modules/config/system-path.nix"; line = 62; } ] ``` -------------------------------- ### SSH into VMs via AF_VSOCK Source: https://nixos.org/manual/nixos/stable/release-notes Connect to virtual machines using SSH over AF_VSOCK. Requires hypervisor support and an SSH key for the root user. ```bash ssh root@.host ``` -------------------------------- ### Configure MySQL Galera Cluster Source: https://nixos.org/manual/nixos/stable/release-notes Enable and configure a MySQL Galera Cluster with specified node details. Ensure services.mysql.enable is also set to true. ```nix { services.mysql = { enable = true; galeraCluster = { enable = true; localName = "Node 1"; localAddress = "galera_01"; nodeAddresses = [ "galera_01" "galera_02" "galera_03" ]; }; }; } ``` -------------------------------- ### GitLab Registry Configuration Source: https://nixos.org/manual/nixos/stable/release-notes This snippet demonstrates how to switch to GitLab's recommended container registry package (`pkgs.gitlab-container-registry`) when the external registry (`pkgs.docker-distribution`) is deprecated in GitLab 16. ```nix services.gitlab.registry.package = pkgs.gitlab-container-registry; ``` -------------------------------- ### Use Nixpkgs Tarball as Flake Input Source: https://nixos.org/manual/nixos/stable/release-notes Use the Nixpkgs tarball from channels.nixos.org as a Nix Flake input by specifying the URL. This allows for reproducible builds using specific channel archives. ```nix inputs.nixpkgs.url = "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz"; ``` -------------------------------- ### Configure Prometheus Exporter for PGBouncer using Environment File Source: https://nixos.org/manual/nixos/stable/release-notes Replaces the removed `connectionStringFile` option for the Prometheus PGBouncer exporter. Use `connectionEnvFile` to specify a file containing environment variables for the connection, avoiding password exposure in process command lines. ```nix services.prometheus.exporters.pgbouncer.connectionEnvFile ``` -------------------------------- ### Configure InvoicePlane with Caddy for HTTP Source: https://nixos.org/manual/nixos/stable/release-notes Maintain the old behavior for an InvoicePlane site served by Caddy to use HTTP only, instead of Caddy's automatic HTTPS. ```nix services.caddy.virtualHosts."example.com".hostName = "http://example.com"; ``` -------------------------------- ### Configure sudo-rs Module Source: https://nixos.org/manual/nixos/stable/release-notes Enable the experimental sudo-rs module for a Rust reimplementation of sudo. Note that terminfo-related environment variables are not preserved for root and wheel, and they cannot set arbitrary environment variables. ```nix security.sudo-rs.enable = true; ``` -------------------------------- ### Enable GNOME Core Developer Tools Source: https://nixos.org/manual/nixos/stable/release-notes Enable GNOME core developer tools, including `sysprof` and `d-spy`, by setting `services.gnome.core-developer-tools.enable`. This option provides access to system profiling and debugging tools. ```nix services.gnome.core-developer-tools.enable ``` -------------------------------- ### Replace Prisma Package Source: https://nixos.org/manual/nixos/stable/release-notes The `nodePackages.prisma` package has been replaced by `prisma`. ```nix nodePackages.prisma ``` -------------------------------- ### Enable NVIDIA Open-Source Driver Source: https://nixos.org/manual/nixos/stable/release-notes Use the new `hardware.nvidia.open` option to enable the usage of NVIDIA’s open-source kernel driver. Note that support for GeForce and Workstation GPUs is still in alpha. ```nix hardware.nvidia.open ``` -------------------------------- ### Enable nsncd Service Source: https://nixos.org/manual/nixos/stable/release-notes Help test the new `nsncd` implementation by setting `services.nscd.enableNsncd` to `true`. This service replaces `nscd` for resolving hostnames and users. ```nix services.nscd.enableNsncd = true; ``` -------------------------------- ### Enable Initrd Backdoor for NixOS Tests Source: https://nixos.org/manual/nixos/stable/release-notes Enable the backdoor service in the initrd for NixOS tests. This requires boot.initrd.systemd to be enabled and allows commands to be sent to test and debug Stage 1. ```nix testing.initrdBackdoor ``` -------------------------------- ### Update systemd.coredump configuration Source: https://nixos.org/manual/nixos/stable/release-notes Replace the removed `systemd.coredump.extraConfig` option with the structured `systemd.coredump.settings.Coredump` for setting `coredump.conf(5)` options. ```nix systemd.coredump.extraConfig = "Storage=journal"; ``` ```nix systemd.coredump.settings.Coredump.Storage = "journal"; ``` -------------------------------- ### Manage Global Mesa Version Source: https://nixos.org/manual/nixos/stable/release-notes Manage the global Mesa version without a mass rebuild by setting `hardware.graphics.package`. This allows for more flexible graphics driver updates. ```nix hardware.graphics.package ``` -------------------------------- ### Configure Mattermost user limits and badges Source: https://nixos.org/manual/nixos/stable/release-notes Override the Mattermost package to disable user limits and free badges when upgrading to version 11, which defaults to Postgres and restricts users. ```nix { services.mattermost.package = pkgs.mattermost.override { removeUserLimit = true; removeFreeBadge = true; }; } ``` -------------------------------- ### Configuring NetBox Package Version Source: https://nixos.org/manual/nixos/stable/release-notes Specify the NetBox package version using `services.netbox.package`. Defaults to v3.6 if `stateVersion` is earlier than 24.05. Database migrations run automatically. ```nix services.netbox.package = pkgs.netbox_3_7; ``` -------------------------------- ### Shiori HTTP Secret Environment Variable Source: https://nixos.org/manual/nixos/stable/release-notes The `services.shiori` service now requires the `SHIORI_HTTP_SECRET_KEY` to be provided as an environment variable. Use `services.shiori.environmentFile` to manage this. ```nix services.shiori.environmentFile ``` -------------------------------- ### Migrate Caddy Options for InvoicePlane Source: https://nixos.org/manual/nixos/stable/release-notes Migrate custom Caddy options for an InvoicePlane site by removing the 'http://' prefix from the virtual host configuration. ```nix services.caddy.virtualHosts."http://example.com" ``` -------------------------------- ### Importing NixOS Modules via Environment Variable Source: https://nixos.org/manual/nixos/stable/release-notes This snippet shows how to import NixOS modules using the NIXOS_EXTRA_MODULE_PATH environment variable. This is a workaround for a deprecated feature, and updating expression files is recommended. ```nix { imports = [ (builtins.getEnv "NIXOS_EXTRA_MODULE_PATH") ]; } ``` -------------------------------- ### Disable File System Overrides in QEMU VMs Source: https://nixos.org/manual/nixos/stable/release-notes Prevent the qemu-vm.nix module from overriding fileSystems, allowing VMs to boot from external disk images. This is achieved by setting virtualisation.fileSystems to an empty list using lib.mkForce. ```nix virtualisation.fileSystems = lib.mkForce { }; ``` -------------------------------- ### Enable Perlless Profile in NixOS Configuration Source: https://nixos.org/manual/nixos/stable/release-notes Use this profile to create a system without Perl. This is an opt-in mechanism to replace Perl scripts used during NixOS activation. ```nix { modulesPath, ... }: { imports = [ "${modulesPath}/profiles/perlless.nix" ]; } ``` -------------------------------- ### Stalwart Mail System User Change Source: https://nixos.org/manual/nixos/stable/release-notes The `services.stalwart-mail` service now runs under the `stalwart-mail` system user instead of a dynamic one. This requires manually moving the state directory and updating its ownership. ```nix services.stalwart-mail ``` -------------------------------- ### Restoring kbrequest.target to rescue.target Symlink Source: https://nixos.org/manual/nixos/stable/release-notes This configuration snippet restores the previous behavior where the systemd target `kbrequest.target` was symlinked to `rescue.target`. This is useful if your workflow relies on the Alt+ArrowUp shortcut to change the current target to `rescue.target`. ```nix systemd.targets.rescue.aliases = [ "kbrequest.target" ]; ``` -------------------------------- ### Rename GNOME Core Utilities Option Source: https://nixos.org/manual/nixos/stable/release-notes The option `services.gnome.core-utilities.enable` has been renamed to `services.gnome.core-apps.enable`. This change reflects the functionality of the option more accurately. ```nix services.gnome.core-apps.enable ``` -------------------------------- ### Customizing Fcitx5 RIME Data Source: https://nixos.org/manual/nixos/stable/release-notes This snippet demonstrates how to customize RIME data packages for Fcitx5 when the default `i18n.inputMethod.fcitx5.enableRimeData` option is removed. Users can specify desired RIME data packages using `pkgs.rime-data` and other packages. ```nix fcitx5-rime.override { rimeDataPkgs = [ pkgs.rime-data # ... ]; } ``` -------------------------------- ### Teleport Upgrade to Version 11 Source: https://nixos.org/manual/nixos/stable/release-notes This snippet shows how to upgrade Teleport to an intermediate version 11.x by explicitly setting the package. This is recommended when upgrading across major versions (e.g., from 10 to 12). ```nix services.teleport.package = pkgs.teleport_11; ``` -------------------------------- ### Override PHP Options in Nextcloud Source: https://nixos.org/manual/nixos/stable/release-notes Use `lib.mkForce` to override all default PHP options for Nextcloud, including upload size and memory limits. This is useful when specific configurations are required that differ from the system defaults. ```nix { services.nextcloud.phpOptions = lib.mkForce { # ... }; } ``` -------------------------------- ### Securely Pass WPA Supplicant Secrets Source: https://nixos.org/manual/nixos/stable/release-notes Pass secrets like Pre-Shared Keys for wpa_supplicant safely using networking.wireless.environmentFile. This prevents non-root users from reading the configuration file. ```nix networking.wireless.environmentFile ``` -------------------------------- ### Upgrade Nextcloud Version Source: https://nixos.org/manual/nixos/stable/release-notes Upgrade from an older Nextcloud version to a newer one by specifying the intermediate package. Direct upgrades across major versions are not supported. ```nix services.nextcloud.package = pkgs.nextcloud32; ``` -------------------------------- ### Restore Default inetutils Priority Source: https://nixos.org/manual/nixos/stable/release-notes If `inetutils` has a lower priority and shadows `util-linux`, you can restore its default priority using this Nix expression. ```nix lib.setPrio 5 inetutils ``` ```nix meta.priority = 5 ``` -------------------------------- ### Set Shiori HTTP Secret Key Source: https://nixos.org/manual/nixos/stable/release-notes Use this snippet to set the Shiori HTTP secret key by generating a random hex string and saving it to an environment file. Ensure the environment file path is correctly configured in services.shiori.environmentFile. ```shell # $ printf "SHIORI_HTTP_SECRET_KEY=%s\n" "$(openssl rand -hex 16)" > /path/to/env-file services.shiori.environmentFile = "/path/to/env-file"; ``` -------------------------------- ### Refactored FRR Configuration Source: https://nixos.org/manual/nixos/stable/release-notes Illustrates the refactored configuration for `services.frr` using upstream service scripts. Per-daemon configurations are replaced by an integrated `vtysh-config` style, and daemon submodules now use daemon names instead of protocol names. ```nix options ``` ```nix extraOptions ``` -------------------------------- ### Build Shared Library Without Executable Stack Source: https://nixos.org/manual/nixos/stable/release-notes When building a shared library from source, use these linker flags to prevent the stack from being executable. ```nix mkDerivation { # … env.NIX_LDFLAGS = "-z,noexecstack"; } ``` -------------------------------- ### Haskell Packaging Helper Change Source: https://nixos.org/manual/nixos/stable/release-notes The `haskell.lib.compose.justStaticExecutables` helper now disallows GHC references by default to address closure size issues. Refer to the Haskell section of the Nixpkgs manual for workarounds. ```nix haskell.lib.compose.justStaticExecutables ``` -------------------------------- ### Configure Nginx HTTP/3 Alt-Svc Header Source: https://nixos.org/manual/nixos/stable/release-notes Manually add HTTP/3 availability to Nginx locations using the Alt-Svc header. This is required for Nginx to advertise HTTP/3 support. ```nix { locations."/".extraConfig = '' add_header Alt-Svc 'h3=":$server_port"; ma=86400'; ''; locations."^~ /assets/".extraConfig = '' add_header Alt-Svc 'h3=":$server_port"; ma=86400'; ''; } ``` -------------------------------- ### Update VSCode Language Server Packages Source: https://nixos.org/manual/nixos/stable/release-notes Replace deprecated VSCode language server packages with the maintained `vscode-langservers-extracted` package. ```nix nodePackages.vscode-css-languageserver-bin nodePackages.vscode-html-languageserver-bin nodePackages.vscode-json-languageserver-bin ``` -------------------------------- ### Kubernetes Feature Gates: List to Attribute Set Source: https://nixos.org/manual/nixos/stable/release-notes Configuration for Kubernetes feature gates has changed from a list of strings to an attribute set. This allows for enabling and disabling feature gates more granularly. ```nix { featureGates = [ "EphemeralContainers" ]; extraOpts = pkgs.lib.concatStringsSep " " ([ ''--feature-gates="CSIMigration=false"'' ]); } ``` ```nix { featureGates = { EphemeralContainers = true; CSIMigration = false; }; } ``` -------------------------------- ### Configure ZFS Hibernation Behavior Source: https://nixos.org/manual/nixos/stable/release-notes Control ZFS hibernation behavior using the `boot.zfs.allowHibernation` option. By default, hibernation is disabled to prevent data loss. ```nix boot.zfs.allowHibernation ``` -------------------------------- ### Configure DHCPCD for IPv6 Router Advertisements Source: https://nixos.org/manual/nixos/stable/release-notes Enable DHCPCD to solicit or accept IPv6 Router Advertisements on interfaces using static IPv6 addresses. This is necessary if your network provides both ULA and GUA through SLAAC. ```nix networking.dhcpcd.IPv6rs = true; ``` -------------------------------- ### Force Executable Stack for Shared Library Source: https://nixos.org/manual/nixos/stable/release-notes If a shared library requires an executable stack and it's not enabled by the application, force this behavior using `GLIBC_TUNABLES`. This reduces security and should not be set globally. ```bash GLIBC_TUNABLES=glibc.rtld.execstack=2 ``` -------------------------------- ### Update BorgBackup Extra Arguments to Bash Arrays Source: https://nixos.org/manual/nixos/stable/release-notes The values for `services.borgbackup.jobs.*.extraArgs` and similar options are now Bash arrays. Existing preHook modifications need to be adjusted to append to these arrays. ```bash -extraCreateArgs="$extraCreateArgs --exclude /some/path" +extraCreateArgs+=("--exclude" "/some/path") ``` -------------------------------- ### Configure Mastodon Media Auto-Removal Source: https://nixos.org/manual/nixos/stable/release-notes Configure the automatic removal of remote media attachments older than 30 days in Mastodon using `services.mastodon.mediaAutoRemove`. ```nix services.mastodon.mediaAutoRemove ``` -------------------------------- ### Configure CPU Model-Specific Registers (MSR) Source: https://nixos.org/manual/nixos/stable/release-notes Configure the msr kernel module to provide an interface for reading and writing model-specific registers (MSRs) of an x86 CPU. ```nix hardware.cpu.x86.msr ``` -------------------------------- ### Disable Firewall Logging of Refused Connections Source: https://nixos.org/manual/nixos/stable/release-notes The `networking.firewall.logRefusedConnections` option now defaults to `false`. Setting it to `true` can generate excessive log messages. ```nix networking.firewall.logRefusedConnections = false; ``` -------------------------------- ### Override Dwarf Fortress Version Source: https://nixos.org/manual/nixos/stable/release-notes Use this override to run an earlier version of Dwarf Fortress if needed. This is useful for compatibility with older save files. ```nix dwarf-fortress-packages.dwarf-fortress-full.override { dfVersion = "0.47.5"; } ``` -------------------------------- ### Disable Automatic Nix Path and Registry Configuration for Flakes Source: https://nixos.org/manual/nixos/stable/release-notes Set these options to false to prevent NixOS from automatically setting `NIX_PATH` and the system-wide flake registry when using flake-based configurations. This is recommended for closure-size-constrained non-interactive systems. ```nix nixpkgs.flake.setNixPath = false; nixpkgs.flake.setFlakeRegistry = false; ``` -------------------------------- ### Override Django Package Source: https://nixos.org/manual/nixos/stable/release-notes This snippet shows how to override the default Django package to use a specific version (django_3). This is useful for managing dependencies in Nix. ```nix packageOverrides = self: super: { django = super.django_3; }; ``` -------------------------------- ### Overriding rt_tables Configuration Source: https://nixos.org/manual/nixos/stable/release-notes Setting `environment.etc."iproute2/rt_tables".text` overrides the entire configuration file. This applies to other `CONFIG_FILE_NAME` values as well. ```nix environment.etc."iproute2/rt_tables".text = '' 127.0.0.1 localhost 255.255.255.255 broadcasthost ''; ``` -------------------------------- ### Re-adding MACs to OpenSSH Configuration Source: https://nixos.org/manual/nixos/stable/release-notes If you require MAC-then-encrypt algorithms for compatibility with libraries like libssh2 or older iPhone SSH clients, you can re-add them to the OpenSSH server configuration. ```nix { services.openssh.settings.Macs = [ "hmac-sha2-512" "hmac-sha2-256" "umac-128@openssh.com" ]; } ``` -------------------------------- ### Restore Old Coredns Behavior in Kubernetes Source: https://nixos.org/manual/nixos/stable/release-notes If you want to revert to the old behavior of pulling the upstream container image from Docker Hub for `services.kubernetes.addons.dns.coredns`, configure `services.kubernetes.addons.dns.corednsImage` as shown. This uses `pkgs.dockerTools.pullImage` to fetch the specified image. ```nix { services.kubernetes.addons.dns.corednsImage = pkgs.dockerTools.pullImage { imageName = "coredns/coredns"; imageDigest = "sha256:af8c8d35a5d184b386c4a6d1a012c8b218d40d1376474c7d071bb6c07201f47d"; finalImageTag = "v1.12.2"; hash = "sha256-ZgXEyxVrdskQdgg0ONJ9sboAXEEHTgNsiptk5O945c0="; }; } ``` -------------------------------- ### Modifying Module Parameters Source: https://nixos.org/manual/nixos/stable/release-notes Reload a module with new arguments to modify its parameters. This is common for modules like libpipewire-module-rt. ```json { "context.modules": [ { "name": "libpipewire-module-rt", "args": { "rt.prio": 90 } } ] } ``` -------------------------------- ### Opt-in to Widevine DRM in Chromium Source: https://nixos.org/manual/nixos/stable/release-notes To enable Widevine DRM support in Chromium, explicitly opt-in using `enableWidevine = true`. This is required because Chromium no longer automatically downloads Widevine. ```nix chromium.override { enableWidevine = true; } ``` -------------------------------- ### Disable Default Music Player Source: https://nixos.org/manual/nixos/stable/release-notes Disable the default `decibels` music player by using `environment.gnome.excludePackages`. This option allows customization of default GNOME applications. ```nix environment.gnome.excludePackages ``` -------------------------------- ### Generate HTTP Secret Key Source: https://nixos.org/manual/nixos/stable/release-notes Generates a random hexadecimal string for use as an HTTP secret key and outputs it to a file. This is useful for configuring applications that require a secret key for HTTP communication. ```bash printf "SHIORI_HTTP_SECRET_KEY=%s\n" "$(openssl rand -hex 16)" > /path/to/env-file ``` -------------------------------- ### Clear Execstack Flag from Binary-Only Shared Library Source: https://nixos.org/manual/nixos/stable/release-notes If the source code for a shared library is unavailable, use `patchelf` to remove the executable stack flag. ```bash patchelf --clear-execstack binary-only.so ``` -------------------------------- ### Disable NixOS Stub ELF Loader Source: https://nixos.org/manual/nixos/stable/release-notes This option disables the stub ELF loader that displays an error message for non-NixOS binaries. It is automatically disabled if `programs.nix-ld.enable` is used. ```nix environment.stub-ld.enable = false; ``` -------------------------------- ### Disable Redis RDB Persistence Source: https://nixos.org/manual/nixos/stable/release-notes The Redis module now disables RDB persistence when `services.redis.servers..save = []`, overriding the Redis default behavior. ```nix services.redis.servers..save = [] ``` -------------------------------- ### Disable nsncd NSS Lookup Dispatcher Source: https://nixos.org/manual/nixos/stable/release-notes If problems arise with the new nsncd NSS lookup dispatcher, you can revert to the previous behavior by disabling it using this configuration option. ```nix { services.nscd.enableNsncd = false; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.