From 8f065f24bc3e26aacae9108c0a716a66056e3d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ryan4yin=20=7C=20=E4=BA=8C=E8=8A=B1?= Date: Wed, 7 Oct 2026 18:32:09 +0800 Subject: [PATCH] feat(nix): use Nix 2.35 via nixVersions.latest (#405) Nix 2.35 brings lazy flake source copying, mimalloc (5-12% faster evaluation), lower nix-daemon memory use, HTTP/3 support, and jittered transfer retries with Retry-After. --- WORKAROUNDS.md | 1 + modules/nixos/base/nix.nix | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/WORKAROUNDS.md b/WORKAROUNDS.md index 6bf7d739..c89f1a8d 100644 --- a/WORKAROUNDS.md +++ b/WORKAROUNDS.md @@ -27,6 +27,7 @@ A version or revision pinned for a reason that can go away. | WA-007 | WeChat from `nixpkgs-master` — `hardening/bwraps/default.nix` | newest builds; the pinned channel lags | Fall back to the stable channel once it has a good build | 2026-10-03 | on nixpkgs bump | active | | WA-020 | `fcitx5-vinput` pinned to release tag `v2.4.0` — `flake.nix`; consumer `home/linux/gui/base/vinput/default.nix` | Tracks a release tag instead of a branch, so `just up` stays on that release | Bump to a newer release tag when its changes are wanted | 2026-10-04 | on vinput release | active | | WA-021 | `nix-x86-on-aarch64` input — our fork of rowanG077's patched FEX + muvm runtime — `flake.nix`; `hosts/12kingdoms-shoukei/game/` | FEX does not support 16K pages, so x86/x86_64 apps and games on shoukei need this pinned flake's 4K-page microVM runtime; our fork lets upstream changes be reviewed before use | Drop once FEX supports 16K pages directly, or nixpkgs/nixos-apple-silicon ships an equivalent runtime | 2026-10-07 | on FEX/nixpkgs/muvm update | active | +| WA-023 | `nix.package = pkgs.nixVersions.latest` — `modules/nixos/base/nix.nix` | NixOS is opted into Nix 2.35 (2.35.2), which nixpkgs ships as `nixVersions.latest`, while `nixVersions.stable` is still 2.34 | Drop the override and fall back to the default `pkgs.nix` once `nixVersions.stable` is 2.35 or newer | 2026-10-07 | next nixpkgs bump | active | ## Workarounds diff --git a/modules/nixos/base/nix.nix b/modules/nixos/base/nix.nix index 985dd170..ec2aab6c 100644 --- a/modules/nixos/base/nix.nix +++ b/modules/nixos/base/nix.nix @@ -1,8 +1,9 @@ -{ lib, ... }: +{ lib, pkgs, ... }: { - # auto upgrade nix to the unstable version - # https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/tools/package-management/nix/default.nix#L284 - # nix.package = pkgs.nixVersions.latest; + # Nix 2.35 is newer than nixpkgs' nixVersions.stable (still 2.34), so opt into + # the latest released version until stable catches up. + # https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/tools/package-management/nix/default.nix + nix.package = pkgs.nixVersions.latest; # https://lix.systems/add-to-config/ # nix.package = pkgs.lix;