Mic92/nixos-shell

Failing with current unstable

viraptor opened this issue · 3 comments

When running nixos-shell with -I nixpkgs=channel:nixos-unstable to get access to packages not available yet in a release, I get a failure to create users:

/nix/store/jrnaxgnf7kskxjb0xilcz42jv86ai8vs-nixos-vm
running activation script...
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "\x{0}\x{0}\x{0}\x{0}...") at /nix/store/sr09hv1nv3ikc7qbnhrgbrcyjjxn8j25-update-users-groups.pl line 10.
Activation script snippet 'users' failed (2)
setting up /etc...
chown: invalid user: 'root:root'
Activation script snippet 'var' failed (1)
chown: invalid user: 'root:root'
chown: invalid user: 'root:messagebus'
chown: invalid user: 'root:root'
chown: invalid user: 'root:root'
...

This results in not being able to log in as root either.

Mic92 commented

What nixpkgs are you using? nix-instantiate -I nixpkgs=channel:nixos-unstable --json --eval --expr "with import <nixpkgs> {}; lib.version"

Mic92 commented
./bin/nixos-shell -I nixpkgs=channel:nixos-unstable ./examples/vm.nix

still works fine here. Try deleting nixos.qcow2 in the same directory. It might be a corruption of your nix user json database. It seems to contain only null bytes.

I was having the same problem. Deleting nixos.qcow2 solved the problem.