Never used Nixos before, but I’ve played a fair bit with other lfavours of linux.
I installed Nixos (with Plasma DE) to a separate partition and, after some trauma, booted it. (I use Refind, which cannot natively boot Nixos, or at least it didn’t work for me. I had to let it boot systemd, which does boot Nixos). I couldn’t understand the “curl” option for installing, and I was a bit worried about clobbering my daily driver (I’ve done it before…), so I downloaded the iso and installed from that.
I followed this webpage Install and Remove Packages in NixOS to install some packages I wanted, but I found some things seemed to work, some didn’t.
I tried installing Vivaldi browser using “nix-shell -p vivaldi”, but nixos refused to install it as it has an unfree license. I have unfree set to true in configuration.nix, so not sure why this is happening.
So I tried installing thonny, and this worked, although it did not add a launcher to application launcher. I can only launch it by typing “thonny” in Konsole. I manually created a launcher for it, which works, but do I have to manually create a launcher for every package I install?
I tried installing Pycharm, with basically the same result.
I then found that these packages all disappeared on reboot. I then learned that installing them with nix-shell is basically a temporary install, so that’s a very useful feature.
So I added all the packages I wanted to configuration.nix, like this:
‘’’
users.users.ian = {
isNormalUser = true;
description = “Ian”;
extraGroups = [ “networkmanager” “wheel” ];
packages = with pkgs; [
kdePackages.kate
thunderbird-latest
vivaldi
novelwriter
jetbrains.pycharm-community
thonny
saleae-logic-2
spotify
libreoffice-qt6-fresh
python3Full
];
};
‘’’
then did “sudo nixos-rebuild switch”. This failed with these messages:
‘’’
[ian@nixos:~]$ sudo nixos-rebuild switch
building Nix…
building the system configuration…
evaluation warning: The option services.xserver.displayManager.autoLogin' defined in
/etc/nixos/configuration.nix’ has been renamed to `services.displayManager.autoLogin’.
updating systemd-boot from 254.8+suse.22.g67a5ac1043 to 256.10
Skipping “/boot/EFI/systemd/systemd-bootx64.efi”, same boot loader version in place already.
Skipping “/boot/EFI/BOOT/BOOTX64.EFI”, same boot loader version in place already.
Traceback (most recent call last):
File “/nix/store/5xv8g58iy3cwl9kk6ca2df26sy9zqdhv-systemd-boot/bin/systemd-boot”, line 435, in
main()
File “/nix/store/5xv8g58iy3cwl9kk6ca2df26sy9zqdhv-systemd-boot/bin/systemd-boot”, line 418, in main
install_bootloader(args)
File “/nix/store/5xv8g58iy3cwl9kk6ca2df26sy9zqdhv-systemd-boot/bin/systemd-boot”, line 352, in install_bootloader
run(
File “/nix/store/5xv8g58iy3cwl9kk6ca2df26sy9zqdhv-systemd-boot/bin/systemd-boot”, line 58, in run
return subprocess.run(cmd, check=True, text=True, stdout=stdout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/nix/store/lhpwdis5hkyljz1d200bj1s6g51ljq9k-python3-3.12.8/lib/python3.12/subprocess.py”, line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[’/nix/store/w9qcpyhjrxsqrps91wkz8r4mqvg9zrxc-systemd-256.10/bin/bootctl’, ‘–esp-path=/boot’, ‘update’]’ returned non-zero exit status 1.
Failed to install bootloader
warning: error(s) occurred while switching to the new configuration
‘’’
It seems no packages were installed. The two launchers I created for thonny and pycharm are still there but neither of them work.
Anybody have any idea why this error is occurring? I’ve trawled lots of fora and reddit, and found a couple of tips. One was to not use Ventoy to boot Nixos. I had used it, so I burned the iso to a fresh usb stick and installed it from that, but the error remains. I tried sudo bootctl install, which worked. But nixos-rebuild still fails with the same error.
I found a lot of boot entries using bootctl list, including lots from a distro I had installed and deleted years ago. I deleted all those entries. There is one still there for Nobara, my daily drive, but Refind boots that directly, not through systemd. I thought I better leave it in case deleting it would cause Nobara to not boot any more, so I don’t know if that’s affecting anything.
Is there anything else I can try?
All advice gratefully received.
Hey, I’m seeing this post for the first time.
The first thing that stands out to be is that
users.users."ian".packages = with pkgs; [
...
];
should probably be
environment.systemPackages = with pkgs; [
...
];
unless your intent is that they should only be available for the ian
user.
That shouldn’t be causing your bootloader issues though; can you share your hardware-configuration.nix
?
Apologies for the late reply. I only check back on this issue every couple of days.
I’m the only one who uses my PC so it doesn’t really matter whether they are available just for me or anybody. I tried putting them in the environment.systemPackages block, but same result.
I did actually get it to work by deleting the EFI/BOOT/BOOTX64.EFI and systemd/systemd-bootx64.efi. It worked twice, then went back to the same warnings, (skipping, same boot loader version exists) then failing as it couldn’t install the bootloader. I checked the /boot folder again and they are not there, so don’t know what’s occurring there.
Anyway, this is my hardware-configuration.nix
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/588e27a5-9874-4da2-a87d-13e4bb41560f";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/ABC4-8D13";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/ae9b8005-68c8-47b3-9822-1e2acf7cdedd";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
Ian
have you tried comparing it with nixos-generate-config --show-hardware-config
?
you can use a process substitution to see the diff
diff hardware-configuration.nix <(nixos-generate-config --show-hardware-config)
not sure if it’s going to be helpful but it can be a start
Here’s the output
[ian@nixos:/etc/nixos]$ diff hardware-configuration.nix <(nixos-generate-config --show-hardware-config)
20a21,25
> fileSystems."/home" =
> { device = "/dev/disk/by-uuid/ae9b8005-68c8-47b3-9822-1e2acf7cdedd";
> fsType = "ext4";
> };
>
25,29d29
< };
<
< fileSystems."/home" =
< { device = "/dev/disk/by-uuid/ae9b8005-68c8-47b3-9822-1e2acf7cdedd";
< fsType = "ext4";
[ian@nixos:/etc/nixos]$
Dunno but it looks the same to me… except for those two random numbers. And the missing curly bracket. I checked. It’s there.
fileSystems."/" =
{ device = "/dev/disk/by-uuid/588e27a5-9874-4da2-a87d-13e4bb41560f";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/ABC4-8D13";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/ae9b8005-68c8-47b3-9822-1e2acf7cdedd";
fsType = "ext4";
};
swapDevices = [ ];
:-\
Well, just tried it again after deleting both bootloaders again, and it’s worked again. I’m thinking maybe last time it didn’t work, I thought I’d deleted them but hadn’t (look at my avatar, I’m an old fart…), and now it’s installed some software that I wanted, including Vivaldi.
Progress!!