Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
goyalyashpal opened this issue Mar 19, 2025 · 2 comments

Comments

@goyalyashpal
Copy link

goyalyashpal commented Mar 19, 2025

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`
@goyalyashpal goyalyashpal changed the title nixos-rebuld: error opening Git repo which uses reftable nixos-rebuld: error opening Git repo which uses reftable/sha256 Mar 19, 2025
@goyalyashpal goyalyashpal changed the title nixos-rebuld: error opening Git repo which uses reftable/sha256 nixos-rebuld: error opening Git repo which uses reftable/sha256/compatobject sha1 Mar 19, 2025
@eclairevoyant
Copy link
Contributor

This should be closed as duplicate of NixOS/nix#11561

@goyalyashpal
Copy link
Author

yeah, i was thinking that this doesnt really belong to neither packages, nor modules. but the executables on nixos.

thanks for guiding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants