Nixos not setting up on reboot

Description

I am unable to access anything on boot. neovim does not exist. hyprland exist but does not boot. I would like for my system to not break on boot.
Github Repo: https://github.com/reyioa/nixconf.

System Info

nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.12.34, NixOS, 25.11 (Xantusia), 25.11.20250621.4206c4c`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.28.3`
 - nixpkgs: `/nix/store/z80rhjwv3v53888hsb43kn0f26zc48zf-nixos-25.05.804391.b2485d569675/nixos`

Reproducibility

sudo reboot now
sudo nixos-rebuild build
error: flake 'path:/etc/nixos' does not provide attribute 'packages.x86_64-linux.nixosConfigurations."nixos".config.system.build.nixos-rebuild', 'legacyPackages.x86_64-linux.nixosConfigurations."nixos".config.system.build.nixos-rebuild' or 'nixosConfigurations."nixos".config.system.build.nixos-rebuild'

Steps to Fix

sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
...
  33   2025-06-23 23:39:04
  34   2025-06-24 00:01:44   (current)
sudo /nix/var/nix/profiles/system-34-link/bin/switch-to-configuration switch

The command you want is:

sudo nixos-rebuild boot

Or:

sudo nixos-rebuild switch

If you want the changes to be applied during the current boot.

It is unable to run those commands when it breaks, after I fixed the issue by going to the same generation and run the sudden nixos-rebuild switch the error still persists on reboot

Ah, right. Your hostname is nixos, not desktop. If you change the hostname in your flake.nix that will work.

You can also change your running system’s hostname to desktop, or run sudo nixos-rebuild boot --flake /etc/nixos#desktop.

The fix was switching from grub to systemd boot

boot.loader.grub.enable = true

to

boot.loader.systemd.enable = true

I sincerely doubt that was the fix, the error is clearly that you don’t have the correct hostname in your flake:

You probably just happened to fix that issue when you also changed the bootloader. Using grub doesn’t hurt, so whatever, but for anyone reading by, flipping bootloaders doesn’t solve problems like this.

No, that couldn’t have been the issue. I’ve tried to switch hostnames and running the flake before starting using systemd boot. ive tried switching the hostname to nixos also using

sudo nixos-rebuild switch --extra-experimental-features "flakes" --flake /etc/nixos#desktop
or 
sudo nixos-rebuild boot --extra-experimental-features "flakes"  --flake /etc/nixos#desktop

It seemed that the grub didn’t properly load my configuration on my system. If switching from grub to systemd boot fixed my problem, it fixed my problem. If I reloaded the configuration everything started working as previously stated. If you want to look at my configuration it is linked up in the first post but your solution didn’t help me at all.