Skip to content

Nix 2.26+, the local registries are ignored during lock writes by design, so there's an error for looking up nixpkgs-matrix and nixpkgs-matrix-private #7

@CMCDragonkai

Description

@CMCDragonkai

Describe the bug

  • Attempting to run nix flake update commands
  • Then we try to update the home manager lock file. This is done with nix flake update --flake ~/.config/home-manager
  • However the new nix update, means that lockfile updates ignore system level registry, this causes an error.

    With 2.26+, local registries are ignored during lock writes by design, so your intent (host decides) is undermined at the exact moment you need it (locking).

  • Quick fix is to use --override-input.
    nix flake update --flake ~/.config/home-manager --override-input nixpkgs-matrix-private github:MatrixAI/nixpkgs-matrix-private
    
  • This is a problem for nixpkgs-matrix and nixpkgs-matrix-private TOO. After updating the flake.nix, the lock has to be updated, and that lock updating has to be propagated to nixpkgs-matrix-private, then finally to our own nixos machine too. Each one requires updating the lock file, and referencing the upstream updated git repository too.
  • Long term fix is to host our own global flake registry - we can make it extend the https://channels.nixos.org/flake-registry.json. This just means we override the global registry, and so package aliases will depend on our own registry. This would replace the NixOS configuration that currently sets up nixpkgs-matrix and nixpkgs-matrix-private as system-level registries.

To Reproduce

Try using nix develop when you don't have the necessary lock file.

Expected behavior

Should just pull in the relevant system flake registry.

»» ~
 ♖ nix registry list                                                                                                                                                                        pts/2 19:52:20
system flake:nixpkgs path:/nix/store/4danq4f7rxpsax7bx18709c533v9krii-source
system flake:nixpkgs-matrix github:MatrixAI/nixpkgs-matrix
system flake:nixpkgs-matrix-private github:MatrixAI/nixpkgs-matrix-private
global flake:agda github:agda/agda
global flake:agenix github:ryantm/agenix
global flake:arion github:hercules-ci/arion
global flake:blender-bin github:edolstra/nix-warez?dir=blender
global flake:bundlers github:NixOS/bundlers
global flake:cachix github:cachix/cachix
global flake:composable github:ComposableFi/composable
global flake:disko github:nix-community/disko
global flake:dreampkgs github:nix-community/dreampkgs
global flake:dwarffs github:edolstra/dwarffs
global flake:emacs-overlay github:nix-community/emacs-overlay
global flake:fenix github:nix-community/fenix
global flake:flake-parts github:hercules-ci/flake-parts
global flake:flake-utils github:numtide/flake-utils
global flake:helix github:helix-editor/helix
global flake:hercules-ci-agent github:hercules-ci/hercules-ci-agent
global flake:hercules-ci-effects github:hercules-ci/hercules-ci-effects
global flake:home-manager github:nix-community/home-manager
global flake:hydra github:NixOS/hydra
global flake:mach-nix github:DavHau/mach-nix
global flake:ngipkgs github:ngi-nix/ngipkgs
global flake:nickel github:tweag/nickel
global flake:nix github:NixOS/nix
global flake:nix-darwin github:nix-darwin/nix-darwin
global flake:nix-serve github:edolstra/nix-serve
global flake:nixops github:NixOS/nixops
global flake:nixos-anywhere github:nix-community/nixos-anywhere
global flake:nixos-hardware github:NixOS/nixos-hardware
global flake:nixos-homepage github:NixOS/nixos-homepage
global flake:nixos-search github:NixOS/nixos-search
global flake:nixpkgs github:NixOS/nixpkgs/nixpkgs-unstable
global flake:nixvim github:nix-community/nixvim
global flake:nur github:nix-community/NUR
global flake:patchelf github:NixOS/patchelf
global flake:poetry2nix github:nix-community/poetry2nix
global flake:pridefetch github:SpyHoodle/pridefetch
global flake:sops-nix github:Mic92/sops-nix
global flake:systems github:nix-systems/default
global flake:templates github:NixOS/templates

Screenshots

Platform

»» ~
 ♖ nix --version                                                                                                                                                                            pts/2 19:52:22
nix (Nix) 2.28.4

Additional context

Notify maintainers

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions