Nixos-install can't find iana-etc

I’m trying to install NixOS over alpine. Nix is already installed.

(To be precise, I’m in an alpine docker container that has Nix installed, nixos/nix:2.3.12. I want to create a NixOS container.)

When I try to run nixos-install, I get an error:

# PATH="$PATH" NIX_PATH="$NIX_PATH" `which nixos-install` --root /mnt
building the configuration in /mnt/etc/nixos/configuration.nix...
these derivations will be built:
  /nix/store/01kkz7nkava65h9kjb277qw8j2zj08yc-etc-nscd.conf.drv
  /nix/store/021racdn3dhlbwamdzaa3di8c2n4lsaa-etc-logind.conf.drv
<snip>
copying path '/nix/store/3mlbnbrzy4i7cssdbpgds010514hkdkd-systemd-247.6-man' from 'https://cache.nixos.org'...
copying path '/nix/store/7xp1yxk8d67ik4rfcbxxjrfv6fnch0p5-iana-etc-20210225' from 'https://cache.nixos.org'...
getting attributes of path '/nix/store/7xp1yxk8d67ik4rfcbxxjrfv6fnch0p5-iana-etc-20210225': No such file or directory
copying path '/nix/store/jvrgvvbq6sxzw8fkm292z84lmldv6yqn-kmod-debian-aliases-22-1.1.conf' from 'https://cache.nixos.org'...
cannot build derivation '/nix/store/34pcg40lbin2nwaazbzlcqgmj8k5sx5x-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/p7vnm0qcsjywgdzi5d8566y9rzg6akxn-nixos-system-nixos-21.05.3532.aff647e2704.drv': 1 dependencies couldn't be built
error: build of '/nix/store/p7vnm0qcsjywgdzi5d8566y9rzg6akxn-nixos-system-nixos-21.05.3532.aff647e2704.drv' failed

I did apk add tzdata hoping that would help, but it made no difference.

Sounds like nixos-install fails with getting attributes of path /nix/store/...: No such file or directory · Issue #126141 · NixOS/nixpkgs · GitHub. I think the Nix version in the docker container needs to be upgraded to at least 2.3.15.

1 Like