[wolf@daw:~]$ mc
The program ‘mc’ is not in your PATH. It is provided by several packages.
You can make it available in an ephemeral shell by typing one of the following:
nix-shell -p mc
nix-shell -p minio-client
I have a videoconference running atm. Takes 20min to be ready to reboot
OK, after reboot mc is running. The other application i will test tomorrow… Good night
Ok cool. I guess if it was your first install the PATH was maybe not correctly configured. Later, you usually don’t need to reboot unless you have a kernel update or alike.
After reboot the mc was gone. On Grub i have seen that the config is from yesterday. No other programs are installed. After running again
sudo nixos-rebuild switch --flake “/etc/nixos/#daw”
i can start the nextcloud client.
Could it be that after enabling flakes, i 'm not allowed to run
sudo nixos-rebuild switch…?
Wait, reboot provides you mc
or removes mc
?? Enabling flakes would not change nixos-rebuild
. nixos-rebuild switch
should add a new entry in grub if you asked him to use grub in your configuration.nix. Are you sure you have not used nixos-rebuild build-vm
instead of nixos-rebuild switch
? (that would explain many things, including why mc was not installed)
If using switch
still don’t fix your issues, are you using boot.loader.systemd-boot.enable = true;
or boot.loader.grub.enable = true;
? Maybe copy/paste your current configuration.nix. Do you have also boot.loader.efi.canTouchEfiVariables = true;
? (I recommend you to add it) I’m wondering, maybe your current system uses systemd-boot instead of grub without saying to the BIOS to start systemd-boot (that’s why you need efi.canTouchEfiVariables
as far as I see), and therefore your computer starts an outdated GRUB entry while your current system uses another EFI entry. Maybe you also need to play with the BIOS settings to boot the right entry?
Yes, it does not add a new boot entry… And the system ist using efi…
[wolf@daw:/etc/nixos]$ cat configuration.nix | grep boot
boot.loader.grub.enable = true;
boot.loader.grub.device = “/dev/sda”;
boot.loader.grub.useOSProber = true;
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
Added that line. But shouldn’t it show more here?
[wolf@daw:/etc/nixos]$ sudo nixos-rebuild switch --flake .
building the system configuration…
updating GRUB 2 menu…
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
lsblk: /dev/mapper/no*[0-9]: kein blockorientiertes Gerät
lsblk: /dev/mapper/raid*[0-9]: kein blockorientiertes Gerät
lsblk: /dev/mapper/disks*[0-9]: kein blockorientiertes Gerät
stopping the following units: Mod
For me, it does not look like grub. Btw, that is not the vm! That the normal desktop bare metal.
Maybe there is a function to run grub-install by hand as i have done on debian/ubuntu…? To see whats happen…
I think that efivars allows NixOs to change the default EFI entry used when starting the computer, but apparently the doc mentions that for grub one should use instead opt-boot.loader.grub.efiSupport
.
The documentation mentions:
You must select a boot-loader, either systemd-boot or GRUB. The recommended
option is systemd-boot: set the optionopt-boot.loader.systemd-boot.enable
totrue
.nixos-generate-config
should do this automatically
for new configurations when booted in UEFI mode.
You may want to look at the options starting with
boot.loader.efi
and
boot.loader.systemd-boot
as well.
If you want to use GRUB, set tonodev
and opt-boot.loader.grub.efiSupport totrue
.
With systemd-boot, you should not need any special configuration to detect
other installed systems. With GRUB, set opt-boot.loader.grub.useOSProber
totrue
, but this will only detect windows partitions, not other Linux
distributions. If you dual boot another Linux distribution, use systemd-boot
instead.
So unless you really want to use grub, I would just put in my configuration instead something like:
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
I use that and I have never had any issue.
Also, maybe double check if you are booting with UEFI (most modern computers use uefi, but if you prepared your USB stick poorly during the installation, it might not be the case, and you might have booted in legacy mode). What is the output of:
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
I can check this this evening, now i’m in the office. But here i have the same DELL workstation to make a fresh test. It is nothing installed on it.
Btw.
I’m afraid I’ve made a mistake. I had already adapted the config**.nix from a KVM VM with all the packages and the settings below for the OBS kernel driver and the automatic cleanup. I adopted this config 1:1 on the bare metal and it may be that there is something different about booting in the config created during setup. Because the VM is BIOS boot!
And yes. There will be later a 2nd disk in the system to run my linux mint based radio production software. This disk is now in another system with bios boot running and his boot record is written in the / (dev/sda3) partition from the radio system partition, so the grub located on the main os (voidlinux) on /dev/sda1 can detect the radio os on sda3… If u understand what i’m writing here…
Ohhh indeed this can definitely be an issue, I’m even surprised to see it working if you have not changed the hardware configuration at all ^^’ This explains why your system was configured to use grub and not systemd-boot, as systemd-boot is enabled by default only if you booted UEFI. This also likely explains why you do not have new entries when you reboot: the wiki explains that this usually occurs when the EFI partition is not mounted correctly in /boot
. So solution here is to make sure the hardware-configuration.nix
contains a properly configured fileSystems."/boot"
… this file is usually automatically generated when first install NixOs, auto-detecting the mounted partitions. So you can either try to add this line… but to be honest I would just restart from scratch to get a really clean install, letting NixOs automatically generate the hardware-configuration.nix
, especially if you are not booting in UEFI right now. My advise would be to simply follow the usual installation instructions from NixOS Manual and let nixos-generate-config
configure it properly. Once you have a working basic NixOs installation, you can start to update the configuration, adding new programs, flake etc…
Ahah seems like you like complicated setups, with no less than 3 OS at a time ^^ (but who knows, you might only use NixOs soon ) My hope is that if you use systemd-boot, it will recognize everything directly In the worse case, you can manually add entries to the boot menu later for instance using boot.loader.systemd-boot.extraEntries, or, if you prefer, via an external tool like rEFInd.
Hmm, i’ve only exchanged the configuration.nix file , not the hardware-conf… But i have to take a look. For the other DELL system laying around in my office i can test it with a fresh install. This is post 53. First i have to search for all the config templates in this thread and write them to a howto file… Or i create a Github account to store this like this… Like u do…
Oh, so it is less problematic then. I’d first check if you run in UEFI or no, if so it might just be a matter of configuring properly a few boot-related lines at I wrote above. Can you maybe post your hardware-conf and ls /boot
?
If you do a fresh install on your DELL, just follow NixOS 23.11 manual | Nix & NixOS without worrying about the above flake template for now. Once your system just runs & update works and appear in the menu, you can enable flake later if you want.
OK, this is written from the fresh install. And yes, there are other boot settings…
https://paste.simplylinux.ch/view/07043f78
Now i test if the system is creating boot entrys
Looks good to me, just I would rather use environment.systemPackages
to install packages, not users.users.wolf.packages
, unless you have a reason to install a package only for a single user.
Thats the default. Firefox i mean… I now have added mc and wget furter down and it creates a new boot entry. Question ist, if the system can detect other boot records on for example /dev/sdb1, the 2nd disk.??
But that should work. Now i would like to insert your config and the flake to get all packages from unstable without first from stable… To save disk.
Great.
According to documentation, it should. If not, you can still manually edit the entries as I mentioned before.
Then, just copy the flake.nix
I posted earlier, add the nix = {…}
thing in your configuration.nix
, and make sure to add lib
and inpus
to the first line of configuration.nix
as you did before.
Well, you will never download stable + unstable when you install one package, nix is clever enough to directly pick the right version. Right now, without flake, the system uses an environment variable to know the channel to use, that you can check for instance via:
$ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-unstable
If you do not follow the unstable channel, you can change the channel via:
$ nix-channel --add https://nixos.org/channels/nixos-unstable nixos
and this is completely fine, next time you nixos-rebuild switch
, your system will run unstable (you can use $ nix-garbage-collect -d
when you want to remove older generations once you are sure your system boots correctly). You can read more here Nix channels - NixOS Wiki
If you only use configuration.nix
to install softwares, this is fine. Some “space issues” might arise if you start to also use imperative-style installations like nix profile install firefox
. nix profile install firefox
will install by default the very latest version of firefox: if it requires a library version 4.2 and your system uses version 4.0, then you will have both versions installed at the same time, which will waste some space. The flake code I added above ensures that all tools (nix-shell
, nix profile
, nix-env
…) use the same nixpkgs, saving therefore disk space since all tools will share the same library version.
Enabling flake with the template I posted above just allows you to never think about which tool uses which version of nixpkgs: they all use the one in /etc/nixos/flake.lock
. Note that if you use imperative style, if you upgrade your system it will not directly upgrade the packages installed imperatively (this is actually a feature). That’s why if you use NixOs, I would just use configuration.nix
for packages you want to install permanently, and nix-shell -p yourprogram
for programs you just need temporarily.
OK, added the flake and changed the line with lib, inputs,… And inserted ur flake enable config. Now ist building atm. That takes some time.
Next i would put in the package-list and the settings for the obs kernelmodul…
But from now on i don’t work with the channels…? And i update that way?
Ah, it boot with a new name uakari…