Having trouble installing NixOS

I am trying to install NixOS on my main machine. This is my configuration:

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  # Use the systemd-boot EFI boot loader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  networking.hostName = "nixos"; # Define your hostname.
  networking.wireless.enable = false;  # Enables wireless support via wpa_supplicant.

  # Set your time zone.
  time.timeZone = "America/New_York";

  # The global useDHCP flag is deprecated, therefore explicitly set to false here.
  # Per-interface useDHCP will be mandatory in the future, so this generated config
  # replicates the default behaviour.
  networking.useDHCP = false;
  networking.interfaces.enp10s0.useDHCP = true;

  # Configure network proxy if necessary
  networking.proxy.default = "http://user:password@proxy:port/";
  networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.UTF-8";
  console = {
    font = "Lat2-Terminus16";
    keyMap = "us";
  };

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Enable sound.
  sound.enable = true;

  users.users.test = {
    isNormalUser = true;
    extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
    shell = pkgs.dash;
  };

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
    neovim
    wget
    dash
    git
    stow
  ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  programs.mtr.enable = true;
  programs.gnupg.agent = {
    enable = true;
    enableSSHSupport = true;
  };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  networking.firewall.allowedTCPPorts = [
    80
    443
  ];
  networking.firewall.allowedUDPPorts = [ ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  programs.sway = {
    enable = true;
    wrapperFeatures.gtk = true; # so that gtk works properly
    extraPackages = with pkgs; [
      swaylock
      swayidle
      wl-clipboard
      alacritty # Alacritty is the default terminal in the config
      bemenu # Dmenu is the default in the config but i recommend wofi since its wayland native
    ];
  };

  fonts.fonts = with pkgs; [
    noto-fonts
    noto-fonts-cjk
    noto-fonts-emoji
    jetbrains-mono
  ];

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "21.05"; # Did you read the comment?
}

This is the error I am getting:

[nixos@nixos:~]$ sudo nixos-install --show-trace
building the configuration in /mnt/etc/nixos/configuration.nix...
these derivations will be built:
  /nix/store/l472cy25k6m4k5x54vfxn0wp9yy9i58q-firmware.drv
  /nix/store/41c36z0kdmjmgh1cyqwaxp4gwh873bcs-linux-5.10.70-modules-shrunk.drv
  /nix/store/h9lljazd7v12v6d5jsyr8s1dnvra9dj3-etc-nixos.conf.drv
  /nix/store/rngw9cjbasy9s4p2dqmpg6ychj8a7r8w-fc-cache.drv
  /nix/store/p5cajy6p8ddm4l61i78di8351bfcynmb-fc-00-nixos-cache.conf.drv
  /nix/store/ic5im4klx99k6icgza5b4kdfwjrfkzjh-fontconfig-conf.drv
  /nix/store/w437kl940ilvdgmbimj794s3g499jgqk-fontconfig-etc.drv
  /nix/store/ls6yz23rrlg2mghd41ba3pwybvpr9bgp-etc.drv
  /nix/store/n12vl3d3l08qfx9bax8zw5fnz3r4nfq3-stage-1-init.sh.drv
  /nix/store/pq6ih9sxhqmbkwj2xbr9mg21viykh7dg-initrd-linux-5.10.70.drv
  /nix/store/pnxappgqphwjnpgp7s197aywwigl0k3r-nixos-system-nixos-21.05.3709.781b1f8e3a2.drv
these paths will be fetched (182.95 MiB download, 719.98 MiB unpacked):
  /nix/store/afiir4cny17x6vqhvc53nn3gdyxg0wq0-firmware-linux-nonfree-2021-09-19
  /nix/store/sx39p1kyj4sss9srsn5cg3agq50f0m40-JetBrainsMono-2.225
copying path '/nix/store/afiir4cny17x6vqhvc53nn3gdyxg0wq0-firmware-linux-nonfree-2021-09-19' from 'https://cache.nixos.org'...
copying path '/nix/store/sx39p1kyj4sss9srsn5cg3agq50f0m40-JetBrainsMono-2.225' from 'https://cache.nixos.org'...
getting attributes of path '/nix/store/sx39p1kyj4sss9srsn5cg3agq50f0m40-JetBrainsMono-2.225': No such file or directory
cannot build derivation '/nix/store/p5cajy6p8ddm4l61i78di8351bfcynmb-fc-00-nixos-cache.conf.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ic5im4klx99k6icgza5b4kdfwjrfkzjh-fontconfig-conf.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/w437kl940ilvdgmbimj794s3g499jgqk-fontconfig-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ls6yz23rrlg2mghd41ba3pwybvpr9bgp-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/pnxappgqphwjnpgp7s197aywwigl0k3r-nixos-system-nixos-21.05.3709.781b1f8e3a2.drv': 1 dependencies couldn't be built
error: build of '/nix/store/pnxappgqphwjnpgp7s197aywwigl0k3r-nixos-system-nixos-21.05.3709.781b1f8e3a2.drv' failed

Tell me if there are any other details I should provide.

1 Like

Try to remove jetbrains-mono from your list of fonts, it might be broken somehow.

Looks like you may be running into nixos-install fails with getting attributes of path /nix/store/...: No such file or directory · Issue #126141 · NixOS/nixpkgs · GitHub