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

Install failure #3

Closed
shazow opened this issue Dec 29, 2018 · 6 comments
Closed

Install failure #3

shazow opened this issue Dec 29, 2018 · 6 comments

Comments

@shazow
Copy link
Owner

shazow commented Dec 29, 2018

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.

@ottidmes
Copy link

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

@shazow
Copy link
Owner Author

shazow commented Dec 29, 2018

@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

@shazow
Copy link
Owner Author

shazow commented Dec 29, 2018

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.

@shazow
Copy link
Owner Author

shazow commented Dec 29, 2018

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.

@shazow
Copy link
Owner Author

shazow commented Dec 30, 2018

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

@shazow
Copy link
Owner Author

shazow commented Dec 30, 2018

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.

@shazow shazow closed this as completed Dec 30, 2018
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