Open rscorer opened 4 months ago
$ niv --version
0.2.22
Ubuntu 23.10
Linux nixie 6.5.0-17-generic #17-Ubuntu SMP PREEMPT_DYNAMIC Thu Jan 11 14:01:59 UTC 2024 x86_64 GNU/Linux
On DigitalOcean
Nix installed with The Determinate Nix Installer
Hi @rscorer, thanks for the report. Does this happen consistently? What happens if you run the failing command?
$ nix-prefetch-url --unpack https://github.com/nixos/nixpkgs/archive/20f65b86b6485decb43c5498780c223571dd56ef.tar.gz --name 20f65b86b6485decb43c5498780c223571dd56ef.tar.gz
When I remember to delete the local ./nix folder, it happens each time - and I tried various nixOS versions too, all with the same result...
# nix-prefetch-url --unpack https://github.com/nixos/nixpkgs/archive/20f65b86b6485decb43c5498780c223571dd56ef.tar.gz --name 20f65b86b6485decb43c5498780c223571dd56ef.tar.gz
path is '/nix/store/brkw8r1qx8m53zgl585qcrm79chbcb3b-20f65b86b6485decb43c5498780c223571dd56ef.tar.gz'
04n3qgkgj90qzxm8wsgr2pb8q3qvxjrygcchg8sr34p29cb2mv33
Contents of the ./nix folder - maybe this shows how far your tool got?
# tree -a nix
nix
├── sources.json
└── sources.nix
1 directory, 2 files
```{}```
```
# This file has been generated by Niv.
let
#
# The fetchers. fetch_
HTH
@rscorer thanks, I think it might be an issue with the environment set up by nix-shell
. Can you try to run the niv
command outside of the nix-shell
(after having wiped the nix/
folder of course, good point)?
$ $(nix-shell -p niv --run "which niv") init --nixpkgs nixos/nixpkgs --nixpkgs-branch nixos-23.11
@nmattia cool, that seems to have worked 👍
$(nix-shell -p niv --run "which niv") init --nixpkgs nixos/nixpkgs --nixpkgs-branch nixos-23.11
Initializing
Creating nix/sources.nix
Creating nix/sources.json
Importing 'nixpkgs' ...
Adding package nixpkgs
Writing new sources file
Done: Adding package nixpkgs
Done: Initializing
If it would help - I can add your public ssh key to my server so you can poke around and, once you stopped laughing at my mistakes, figure out what I've broken!. It's a VM running on a Digital Ocean trial, I can send you details etc. I've set it up to learn nix, and have rebuilt it a few times already :grinning:
``` { "nixpkgs": { "branch": "nixos-23.11", "description": "Nix Packages collection & NixOS", "homepage": "", "owner": "nixos", "repo": "nixpkgs", "rev": "809cca784b9f72a5ad4b991e0e7bcf8890f9c3a6", "sha256": "174d7cbgjyhlin2lm71chgdqs2cprqphnka9w33nlc1qh226ks3l", "type": "tarball", "url": "https://github.com/nixos/nixpkgs/archive/809cca784b9f72a5ad4b991e0e7bcf8890f9c3a6.tar.gz", "url_template": "https://github.com// /archive/ .tar.gz" } } ```
```
# This file has been generated by Niv.
let
#
# The fetchers. fetch_
Proof I'm learning :wink: - also, would this shell.nix
be interfering with niv?
let nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11"; pkgs = import nixpkgs { config = {}; overlays = []; }; in pkgs.mkShell { packages = with pkgs; [ cowsay lolcat niv ]; GREETING = "Hello, Nix!"; shellHook = '' echo $GREETING | cowsay | lolcat ''; }
Hi, learning nix etc using nix.dev and ran into this issue when executing
nix-shell -p niv --run "niv init --nixpkgs nixos/nixpkgs --nixpkgs-branch nixos-23.11"