{ inputs, lib, ... }: { nix = { settings = { # Enable experimental features for modern Nix commands and flakes experimental-features = [ "nix-command" "flakes" ]; # Allow users in the wheel group to manage the Nix store trusted-users = [ "root" "@wheel" ]; # Optimize storage by hard-linking identical files auto-optimise-store = lib.mkDefault true; # Bump the substituter download buffer from the 64 MiB default to # 512 MiB. Large NARs (kernels, electron apps, the full NixOS # closure on first install) overrun 64 MiB and Nix prints # "download buffer is full" until the consumer catches up — the # warning is harmless but slows substitution and looks like an # error. 512 MiB comfortably covers everything in our closure. download-buffer-size = 524288000; }; # Populates NIX_PATH with the nixpkgs input from the flake. # This is critical for making 'nix-shell -p ...' and other legacy # Nix commands work in a flake-based environment without channels. nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; # Map all flake inputs to the system registry. # This ensures 'nix shell nixpkgs#...' uses the exact same version # as the rest of the system and doesn't need to re-download. registry = lib.mapAttrs (_: value: { flake = value; }) inputs; }; }