shazow / nixfiles

Some of my .nix files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install failure

shazow opened this issue · comments

Trying to do:

https://nixos.org/nixos/manual/index.html#sec-installing-from-other-distro

Using hosts/shazowic-corvus.nix as configuration.nix (the README in the repo has more details about the general setup). Also reproduced with a trivial configuration.nix (see below)

I get this error:

$ nixos-install --no-bootloader --root /mnt/rootnix --show-trace
building the configuration in /mnt/rootnix/etc/nixos/configuration.nix...
error: while setting up the build environment: getting attributes of path '': No such file or directory

How do I debug where the '' is coming from?

Edit: Seems it's a problem with nixos-install when using the nix installed on Arch on aur/nix, see comments.

Guessing from the configuration you linked I would say it either has to be disk.disk.extraInitrd or disk.keyFile:
https://github.com/shazow/nixfiles/blob/master/common/boot.nix#L30
https://github.com/shazow/nixfiles/blob/master/common/boot.nix#L39-L49

@ottidmes Hm, any suggestions for how to better debug these kinds of problems aside from trial and error?

FWIW my disk.nix looks like this: https://github.com/shazow/nixfiles/blob/master/disk.example.nix

I'm assuming it has to do with some path string being empty where it shouldn't be, but I tried hardcoding practically everything in boot.nix and still no luck. Wish I could find out what variable it's failing at.

The exact same configuration does work in a VM with:

# disk.nix
{
  extraInitrd = ./initrd.keys.gz;
  keyFile = "cryptroot.key";
  cryptroot = "/dev/sda2";
  cryptswap = "/dev/sda3";
  efi = "/dev/sda1";
}

Compared to the non-VM install:

{
  extraInitrd = ./initrd.keys.gz;
  keyFile = "cryptroot.key";
  efi = "/dev/nvme0n1p1";
  cryptswap = "/dev/nvme0n1p2";
  cryptroot = "/dev/nvme0n1p3";
}

While using configuration.nix -> hosts/shazowic-ghost.nix

So either the bug is in the difference with common/server.nix vs common/desktop.nix or it's something to do with nixos-install while installing from another distro... Hmm.

Hm, even a purely minimal configuration.nix that was autogenerated fails the same way.

Example of the smallest config:

{ config, pkgs, ... }:

{
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = false;
  system.stateVersion = "18.09";

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/3af5b147-3f68-4a9f-98f1-714df2d45c94";
      fsType = "btrfs";
      options = [ "subvol=@rootnix" ];
    };
}
$ nixos-install --no-bootloader --root /mnt/rootnix
building the configuration in /mnt/rootnix/etc/nixos/configuration.nix...
[2 copied (36.8 MiB), 0.0 MiB DL]
error: while setting up the build environment: getting attributes of path '': No such file or directory

Confirmed that this must be related to using https://aur.archlinux.org/packages/nix/ instead of nix from the bash-curl installer.

Tried the same thing with the bash-curl installer and it worked.