Skip to content

nix registry --registry overrides #15540

@oux

Description

@oux

Describe the bug

Since 2.33.1:
nix registry add/remove/pin --registry ./registry.json ...
cleanups full ./registry.json

Works on 2.32.6

Bug still there on 2.34.2

Steps To Reproduce

Add a new entry nix2331:
nix run github:NixOS/nix/2.33.1 -- registry add --registry ./registry.json nix2331 github:NixOS/nix/2.33.1
Add a new entry nix2333:
nix run github:NixOS/nix/2.33.1 -- registry add --registry ./registry.json nix2333 github:NixOS/nix/2.33.3
cat ./registry.json

{
  "flakes": [
    {
      "from": {
        "id": "nix2333",
        "type": "indirect"
      },
      "to": {
        "owner": "NixOS",
        "ref": "2.33.3",
        "repo": "nix",
        "type": "github"
      }
    }
  ],
  "version": 2
}

All the previous entries has been removed.

Expected behavior

nix run github:NixOS/nix/2.32.6 -- registry add --registry ./registry.json nix2331 github:NixOS/nix/2.33.1
nix run github:NixOS/nix/2.32.6 -- registry add --registry ./registry.json nix2333 github:NixOS/nix/2.33.3
cat ./registry.json

{
  "flakes": [
    {
      "from": {
        "id": "nix2331",
        "type": "indirect"
      },
      "to": {
        "owner": "NixOS",
        "ref": "2.33.1",
        "repo": "nix",
        "type": "github"
      }
    },
    {
      "from": {
        "id": "nix2333",
        "type": "indirect"
      },
      "to": {
        "owner": "NixOS",
        "ref": "2.33.3",
        "repo": "nix",
        "type": "github"
      }
    }
  ],
  "version": 2
}

Metadata

Additional context

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions