Skip to content

nixos-rebuld: error opening Git repo which uses reftable/sha256/compatobject sha1 #391270

Closed as duplicate of#11561
@goyalyashpal

Description

@goyalyashpal

titles / summaries

  • nixos-rebuld: error opening Git repo which uses reftable refs, sha256 objects or even sha1 compat objects.

details

high level steps to reproduce the error:

  1. i initialised a git repo at /xxx as follows to store my nixos config files in. the /etc/nixos/configuration.nix is symlinked to file in this repo.
git init --ref-format=reftable --object-format=sha256 --initial-branch=main /xxx
  1. now i want to switch to using flakes. so, i created flake.nix in this repo, and create symlink in /etc/nixos/flake.nix to point to this.

  2. running sudo nixos-rebuild dry-build results in following error.

building the system configuration...
error:
       … while fetching the input 'git+file:///xxx'

       error: opening Git repository '"/xxx"': unsupported extension name extensions.refstorage
[ble: exit 1]
  1. i tried fixing it with creating a dummy repo /yyy as follows, and symlinking the /etc/nixos/flake.nix to it:
git clone /etc-nixos .

## Tried with these too:
# git clone --depth=1 --config extensions.compatObjectFormat=sha1 file:///yyy/ .
# git clone --depth=1 --config=extensions.objectFormat=sha1 file:///etc-nixos .
  1. now, it shows the error:
$ sudo nixos-rebuild dry-build
building the system configuration...
error:
       … while fetching the input 'git+file:///yyy'

       error: opening Git repository '"/yyy"': unknown object format 'sha256'
[ble: exit 1]

or
+

$ sudo nixos-rebuild dry-build
building the system configuration...
error:
       … while fetching the input 'git+file:///yyy?shallow=1'

       error: opening Git repository '"/yyy"': unsupported extension name extensions.compatobjectformat
[ble: exit 1]

environment

$ nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.77, NixOS, 24.11 (Vicuna), 24.11.714614.c618e28f7025`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.12`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions