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

Fails during NixOS installation step #451

Open
mainrs opened this issue Jan 12, 2025 · 0 comments
Open

Fails during NixOS installation step #451

mainrs opened this issue Jan 12, 2025 · 0 comments

Comments

@mainrs
Copy link

mainrs commented Jan 12, 2025

I get this output after a bunch of paths are copied from cache.nixos.org.

### Installing NixOS ###
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '<ip>' (ED25519) to the list of known hosts.
installing the boot loader...
setting up /etc...
/nix/var/nix/profiles/system/sw/bin/bash: line 10: /run/current-system/bin/switch-to-configuration: No such file or directory

I run nix run nixpkgs#nixos-anywhere -- --flake .#install --generate-hardware-config nixos-generate-config ./systems/x86_64-linux/install/hardware-configuration.nix --target-host root@<ip>.

My configuration looks like this:

# configuration.nix
imports = [
    ./disk-config.nix
  ];

  boot.loader = {
    efi.canTouchEfiVariables = true;
    systemd-boot.enable = true;
  };

  environment.systemPackages = map lib.lowPrio [
    pkgs.bash
    pkgs.curl
    pkgs.gitMinimal
  ];

  services.openssh.enable = true;

  users.users.root.openssh.authorizedKeys.keys = [
    "<key>"
  ];

  system.stateVersion = "24.05";
}

# disk-config.nix
{ lib, ... }:

{
  disko.devices = {
    disk = {
      main = {
        type = "disk";
        device = lib.mkDefault "/dev/sda";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              name = "ESP";
              start = "1M";
              size = "512M";
              type = "EF00";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = [ "umask=0077" ];
              };
            };

            luks = {
              size = "100%";
              content = {
                type = "luks";
                name = "crypted";
                content = {
                  type = "btrfs";
                  # Override existing partitions.
                  extraArgs = [ "-f" ];
                  subvolumes = {
                    # "@" = {
                    #   mountpoint = "/";
                    #   mountOptions = ["compress=zstd" "noatime"];
                    # };
                    "@persist" = {
                      mountpoint = "/persist";
                      mountOptions = [ "compress=zstd" "noatime" ];
                    };
                    "@nix" = {
                      mountpoint = "/nix";
                      mountOptions = [ "compress=zstd" "noatime" ];
                    };
                    "@swap" = {
                      mountpoint = "/.swapvol";
                      swap.swapfile.size = "1G";
                    };
                  };
                };
              };
            };
          };
        };
      };
    };

    nodev = {
      "/tmp" = {
        fsType = "tmpfs";
        mountOptions = [ "size=200M" ];
      };
      "/" = {
        fsType = "tmpfs";
        mountOptions = [ "size=2G" "mode=755" "defaults" ];
      };
    };
  };
}

My goal is to use impermanence for the device. For the initial setup, that shouldn't matter though. Any idea what the error message means?

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

1 participant