Nginx works, but doesn't start after reboot

I set up NginX on my Pi running NixOS. Everything works as expected, but when I reboot, the service does not start. It doesn’t even exist! When I run sudo nixos-rebuild switch the service is up and running again.

Do you have any idea why that might be? Is it possible somehow the boot entry is not to the new generation?

nginx.nix:

{ config, pkgs, ... }:
{
	 networking.firewall.allowedTCPPorts = [ 80 443 ];
	 security.acme.acceptTerms = true;
	 security.acme.defaults.email = "vanousekmikulas@gmail.com";
	 services.nginx = {
		  enable = true;
		  virtualHosts."pi.vanousek.com" = {
				forceSSL = true;
				enableACME = true;
				root = "/var/www";
		  };
	 };
}
miki in nixpi in 130.89.163.252 ~ took 34s 
❯ sudo systemctl status nginx
● nginx.service - Nginx Web Server
     Loaded: loaded (/etc/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running) since Tue 2022-10-04 10:11:34 CEST; 8s ago
    Process: 6642 ExecStartPre=/nix/store/mpm1nza9s56474bbc0y0hvpfaak1d0v1-unit-script-nginx-pre-start/bin/nginx-pre-start (code=exited, status=0/SUCCESS)
    Process: 6921 ExecReload=/nix/store/silrxmqlassgkq0kvpi26gwx82y8msas-nginx-1.22.0/bin/nginx -c /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf -t (code=exited, status=0/SUCCESS)
    Process: 6923 ExecReload=/nix/store/j02ma9llhq4hc8s28aby33lf92jdbfhx-coreutils-9.1/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
   Main PID: 6720 (nginx)
         IP: 0B in, 0B out
         IO: 15.1M read, 0B written
      Tasks: 2 (limit: 4374)
        CPU: 709ms
     CGroup: /system.slice/nginx.service
             ├─6720 "nginx: master process /nix/store/silrxmqlassgkq0kvpi26gwx82y8msas-nginx-1.22.0/bin/nginx -c /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf"
             └─6925 "nginx: worker process"

Oct 04 10:11:34 nixpi systemd[1]: Starting Nginx Web Server...
Oct 04 10:11:34 nixpi nginx-pre-start[6703]: nginx: the configuration file /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf syntax is ok
Oct 04 10:11:34 nixpi nginx-pre-start[6703]: nginx: configuration file /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf test is successful
Oct 04 10:11:34 nixpi systemd[1]: Started Nginx Web Server.
Oct 04 10:11:37 nixpi systemd[1]: Reloading Nginx Web Server...
Oct 04 10:11:37 nixpi nginx[6921]: nginx: the configuration file /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf syntax is ok
Oct 04 10:11:37 nixpi nginx[6921]: nginx: configuration file /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf test is successful
Oct 04 10:11:37 nixpi systemd[1]: Reloaded Nginx Web Server.

miki in nixpi in 130.89.163.252 ~ 
❯ reboot
Failed to set wall message, ignoring: Access denied
Failed to reboot system via logind: Access denied

miki in nixpi in 130.89.163.252 ~ 
❯ sudo !!
sudo reboot

miki in nixpi in 130.89.163.252 ~ 
❯ Connection to pi.vanousek.com closed by remote host.
Connection to pi.vanousek.com closed.

~ took 3m25s 
❯ ssh-pi
(miki@pi.vanousek.com) Password: 
Last login: Tue Oct  4 10:10:02 2022 from 130.89.168.252

miki in nixpi in 130.89.163.252 ~ 
❯ sudo systemctl status nginx
[sudo] password for miki: 
Unit nginx.service could not be found.

miki in nixpi in 130.89.163.252 ~ took 2s 
❯ snrs
building Nix...
building the system configuration...
would stop swap device: /dev/disk/by-uuid/12bcc21b-f474-4c1c-8abc-283d7889b677
stopping the following units: NetworkManager-wait-online.service, NetworkManager.service, audit.service, cpufreq.service, kmod-static-nodes.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, resolvconf.service, syncthing-init.service, syncthing.service, systemd-modules-load.service, systemd-sysctl.service, systemd-timesyncd.service, systemd-udev-trigger.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service, wpa_supplicant.service
NOT restarting the following changed units: getty@tty1.service, serial-getty@ttyAMA0.service, systemd-fsck@dev-disk-by\x2duuid-FC14\x2dA4D6.service, systemd-journal-flush.service, systemd-logind.service, systemd-random-seed.service, systemd-remount-fs.service, systemd-tmpfiles-setup.service, systemd-update-utmp.service, systemd-user-sessions.service, user-runtime-dir@1000.service, user@1000.service
activating the configuration...
reviving group 'acme' with GID 996
reviving group 'dhcpcd' with GID 999
reviving group 'nscd' with GID 991
removing group ‘networkmanager’
removing group ‘polkituser’
removing group ‘nm-openvpn’
reviving user 'acme' with UID 998
reviving user 'dhcpcd' with UID 999
reviving user 'nscd' with UID 992
removing user ‘nm-openvpn’
removing user ‘polkituser’
removing user ‘nm-iodine’
setting up /etc...
removing obsolete symlink ‘/etc/modprobe.d/nixos-initrd.conf’...
removing obsolete symlink ‘/etc/polkit-1/rules.d/10-nixos.rules’...
removing obsolete symlink ‘/etc/NetworkManager/NetworkManager.conf’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-vpnc-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-openvpn-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-fortisslvpn-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-sstp-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-openconnect-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-l2tp-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-iodine-service.name’...
removing obsolete symlink ‘/etc/pam.d/polkit-1’...
restarting systemd...
reloading user units for miki...
setting up tmpfiles
reloading the following units: dbus.service, firewall.service, reload-systemd-vconsole-setup.service, tmp.mount
restarting the following units: sshd.service, systemd-journald.service
starting the following units: audit.service, cpufreq.service, kmod-static-nodes.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, resolvconf.service, syncthing-init.service, syncthing.service, systemd-modules-load.service, systemd-sysctl.service, systemd-timesyncd.service, systemd-udev-trigger.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket
the following new units were started: acme-finished-pi.vanousek.com.target, acme-fixperms.service, acme-pi.vanousek.com.timer, dev-sda3.swap, dhcpcd.service, logrotate-checkconf.service, nginx.service, nixos-upgrade.timer, swapfile.swap, systemd-vconsole-setup.service

miki in nixpi in 130.89.163.252 ~ took 59s 
❯ sudo systemctl status nginx
● nginx.service - Nginx Web Server
     Loaded: loaded (/etc/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running) since Tue 2022-10-04 10:14:38 CEST; 1min 52s ago
    Process: 1982 ExecStartPre=/nix/store/mpm1nza9s56474bbc0y0hvpfaak1d0v1-unit-script-nginx-pre-start/bin/nginx-pre-start (code=exited, status=0/SUCCESS)
    Process: 2176 ExecReload=/nix/store/silrxmqlassgkq0kvpi26gwx82y8msas-nginx-1.22.0/bin/nginx -c /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf -t (code=exited, status=0/SUCCESS)
    Process: 2177 ExecReload=/nix/store/j02ma9llhq4hc8s28aby33lf92jdbfhx-coreutils-9.1/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
   Main PID: 2052 (nginx)
         IP: 3.8K in, 24.1K out
         IO: 15.7M read, 0B written
      Tasks: 2 (limit: 4374)
        CPU: 656ms
     CGroup: /system.slice/nginx.service
             ├─2052 "nginx: master process /nix/store/silrxmqlassgkq0kvpi26gwx82y8msas-nginx-1.22.0/bin/nginx -c /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf"
             └─2179 "nginx: worker process"

Oct 04 10:14:38 nixpi systemd[1]: Starting Nginx Web Server...
Oct 04 10:14:38 nixpi nginx-pre-start[2035]: nginx: the configuration file /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf syntax is ok
Oct 04 10:14:38 nixpi nginx-pre-start[2035]: nginx: configuration file /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf test is successful
Oct 04 10:14:38 nixpi systemd[1]: Started Nginx Web Server.
Oct 04 10:14:43 nixpi systemd[1]: Reloading Nginx Web Server...
Oct 04 10:14:43 nixpi nginx[2176]: nginx: the configuration file /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf syntax is ok
Oct 04 10:14:43 nixpi nginx[2176]: nginx: configuration file /nix/store/nlk2fpww36rmfgd9aap1a5g9y45pa3nq-nginx.conf test is successful
Oct 04 10:14:43 nixpi systemd[1]: Reloaded Nginx Web Server.
Oct 04 10:16:44 nixpi nginx[2179]: 2022/10/04 10:16:44 [error] 2179#2179: *3 directory index of "/var/www/" is forbidden, client: 130.89.168.252, server: pi.vanousek.com, request: "GET / HTT>

Is it possible somehow the boot entry is not to the new generation?

Yes.

Compare the contents of /nix/var/nix/profiles and whatever system links to with /run/current-system and /run/booted-system to see if that sheds any light on the situation.

Are you sure nixos-rebuild isn’t silently failing with some error like “/boot disk is full” ? This would prevent next reboot to have the new system, but would still configure the current running system.

nixos-rebuild doesn’t fail in that case nixos-rebuild switch exit code shouldn't be 0 when /boot/ is lacking space · Issue #189966 · NixOS/nixpkgs · GitHub

I think I ran into that one before. And running out of RAM.

Yeah, nixos-rebuild is far from being bullet proof and “fail correctly” :frowning:

After I reboot, the /nix/var/nix/profiles/system points to the same generation as after the rebuild. So I think it is the newest generation. Just for some reason, the nginx service is no longer available in systemd.

Do you have the file /nix/var/nix/profiles/system/etc/systemd/system/nginx.service?

Does /etc/systemd/system/nginx.service exist before and after the reboot?

Both files exist before reboot, but /etc/systemd/system/nginx.service disappears after the reboot.

Something seems reverting your system at boot. Is /boot full? You may boot on an older entry because grub didn’t update the profiles list and you are still booting on an older version that doesn’t have nginx.

One way to be sure something is wrong would be to add a package or something unimportant and light, and see if it’s still there after a reboot. I think it won’t.

The program truly disappears as well.

/dev/sda1       500M  380M  120M  76% /boot

Is 120M not enough?

this depend, if you include boot images it requires a LOT more, otherwise it should be fine for a bunch of kernels and their initrd.

Could you share the output of nixos-rebuild?

It’s in the original post. I am trying if removing old generations will fix the issue.

1 Like

Removing old generations brought the usage of /boot down:

/dev/sda1       500M  289M  211M  58% /boot

The issue persists.

Could you paste the output of ls -l /nix/var/nix/profiles/ before doing a switch, and after a switch please?

Before:

❯ ls -l /nix/var/nix/profiles/ 
total 8.0K
drwxr-xr-x 4 root root 4.0K Mar  7  2022 per-user
lrwxrwxrwx 1 root root   15 Oct  9 16:14 system -> system-146-link
lrwxrwxrwx 1 root root   89 Oct  9 15:39 system-146-link -> /nix/store/yxpw1jdx3xf1k67xkfz08wzzc9iafb9m-nixos-system-nixpi-22.11pre414197.fd54651f5ff

After:

❯ ls -l /nix/var/nix/profiles/ 
total 8.0K
drwxr-xr-x 4 root root 4.0K Mar  7  2022 per-user
lrwxrwxrwx 1 root root   15 Oct  9 21:46 system -> system-146-link
lrwxrwxrwx 1 root root   89 Oct  9 15:39 system-146-link -> /nix/store/yxpw1jdx3xf1k67xkfz08wzzc9iafb9m-nixos-system-nixpi-22.11pre414197.fd54651f5ff

Here is the entire procedure. I think the errors are caused by ssh due to the networknig services getting restarted.

Last login: Sun Oct  9 21:14:50 2022 from 130.89.167.198

miki in nixpi in 130.89.163.252 ~ 
❯ ls -l /nix/var/nix/profiles/ 
total 8.0K
drwxr-xr-x 4 root root 4.0K Mar  7  2022 per-user
lrwxrwxrwx 1 root root   15 Oct  9 16:14 system -> system-146-link
lrwxrwxrwx 1 root root   89 Oct  9 15:39 system-146-link -> /nix/store/yxpw1jdx3xf1k67xkfz08wzzc9iafb9m-nixos-system-nixpi-22.11pre414197.fd54651f5ff

miki in nixpi in 130.89.163.252 ~ 
❯ sudo systemctl status nginx
[sudo] password for miki: 
Unit nginx.service could not be found.

miki in nixpi in 130.89.163.252 ~ 
❯ snrs
building Nix...
building the system configuration...
would stop swap device: /dev/disk/by-uuid/12bcc21b-f474-4c1c-8abc-283d7889b677
stopping the following units: NetworkManager-wait-online.service, NetworkManager.service, audit.service, cpufreq.service, kmod-static-nodes.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, resolvconf.service, syncthing-init.service, syncthing.service, systemd-modules-load.service, systemd-sysctl.service, systemd-timesyncd.service, systemd-udev-trigger.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service, wpa_supplicant.service
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
channel 7: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
channel 7: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
channel 7: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
channel 7: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
channel 7: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
channel 7: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
NOT restarting the following changed units: getty@tty1.service, serial-getty@ttyAMA0.service, systemd-fsck@dev-disk-by\x2duuid-FC14\x2dA4D6.service, systemd-journal-flush.service, systemd-logind.service, systemd-random-seed.service, systemd-remount-fs.service, systemd-tmpfiles-setup.service, systemd-update-utmp.service, systemd-user-sessions.service, user-runtime-dir@1000.service, user@1000.service
activating the configuration...
reviving group 'acme' with GID 996
reviving group 'dhcpcd' with GID 999
reviving group 'nscd' with GID 991
reviving group 'systemd-oom' with GID 990
removing group ‘networkmanager’
removing group ‘nm-openvpn’
removing group ‘polkituser’
reviving user 'acme' with UID 998
reviving user 'dhcpcd' with UID 999
reviving user 'nscd' with UID 992
reviving user 'systemd-oom' with UID 991
removing user ‘nm-openvpn’
removing user ‘polkituser’
removing user ‘nm-iodine’
setting up /etc...
removing obsolete symlink ‘/etc/modprobe.d/nixos-initrd.conf’...
removing obsolete symlink ‘/etc/polkit-1/rules.d/10-nixos.rules’...
removing obsolete symlink ‘/etc/NetworkManager/NetworkManager.conf’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-vpnc-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-openvpn-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-fortisslvpn-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-sstp-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-openconnect-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-l2tp-service.name’...
removing obsolete symlink ‘/etc/NetworkManager/VPN/nm-iodine-service.name’...
removing obsolete symlink ‘/etc/pam.d/polkit-1’...
restarting systemd...
reloading user units for miki...
setting up tmpfiles
reloading the following units: dbus.service, firewall.service, reload-systemd-vconsole-setup.service, tmp.mount
restarting the following units: sshd.service, systemd-journald.service
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
starting the following units: audit.service, cpufreq.service, kmod-static-nodes.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, resolvconf.service, syncthing-init.service, syncthing.service, systemd-modules-load.service, systemd-sysctl.service, systemd-timesyncd.service, systemd-udev-trigger.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
the following new units were started: acme-finished-pi.vanousek.com.target, acme-fixperms.service, acme-pi.vanousek.com.timer, dev-sda3.swap, dhcpcd.service, logrotate-checkconf.service, nginx.service, nixos-upgrade.timer, swapfile.swap, systemd-oomd.socket, systemd-vconsole-setup.service

miki in nixpi in 130.89.163.252 ~ took 35s 
❯ sudo systemctl status nginx
● nginx.service - Nginx Web Server
     Loaded: loaded (/etc/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running) since Sun 2022-10-09 21:46:27 CEST; 18s ago
    Process: 1548 ExecStartPre=/nix/store/m8ji38aj99s23na1f2xaxx1vi0dmvdq9-unit-script-nginx-pre-start/bin/nginx-pre-start (code=exited, status=0/SUCCESS)
    Process: 1737 ExecReload=/nix/store/hm33wlr2nhcmm6dn2bsdrx68al5y6ryd-nginx-1.22.0/bin/nginx -c /nix/store/wr83ch287q0mrkssi2c5yy6brq5h2fdv-nginx.conf -t (code=exited, status=0/SUCCESS)
    Process: 1738 ExecReload=/nix/store/a4v028gbv3fkl13l3x8nc71d3r4ma7wx-coreutils-9.1/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
   Main PID: 1615 (nginx)
         IP: 0B in, 0B out
         IO: 15.9M read, 0B written
      Tasks: 2 (limit: 4374)
        CPU: 688ms
     CGroup: /system.slice/nginx.service
             ├─1615 "nginx: master process /nix/store/hm33wlr2nhcmm6dn2bsdrx68al5y6ryd-nginx-1.22.0/bin/nginx -c /nix/store/wr83ch287q0mrkssi2c5yy6brq5h2fdv-nginx.conf"
             └─1740 "nginx: worker process"

Oct 09 21:46:27 nixpi systemd[1]: Starting Nginx Web Server...
Oct 09 21:46:27 nixpi nginx-pre-start[1602]: nginx: the configuration file /nix/store/wr83ch287q0mrkssi2c5yy6brq5h2fdv-nginx.conf syntax is ok
Oct 09 21:46:27 nixpi nginx-pre-start[1602]: nginx: configuration file /nix/store/wr83ch287q0mrkssi2c5yy6brq5h2fdv-nginx.conf test is successful
Oct 09 21:46:27 nixpi systemd[1]: Started Nginx Web Server.
Oct 09 21:46:31 nixpi systemd[1]: Reloading Nginx Web Server...
Oct 09 21:46:31 nixpi nginx[1737]: nginx: the configuration file /nix/store/wr83ch287q0mrkssi2c5yy6brq5h2fdv-nginx.conf syntax is ok
Oct 09 21:46:31 nixpi nginx[1737]: nginx: configuration file /nix/store/wr83ch287q0mrkssi2c5yy6brq5h2fdv-nginx.conf test is successful
Oct 09 21:46:32 nixpi systemd[1]: Reloaded Nginx Web Server.

miki in nixpi in 130.89.163.252 ~ took 9s 
❯ ls -l /nix/var/nix/profiles/ 
total 8.0K
drwxr-xr-x 4 root root 4.0K Mar  7  2022 per-user
lrwxrwxrwx 1 root root   15 Oct  9 21:46 system -> system-146-link
lrwxrwxrwx 1 root root   89 Oct  9 15:39 system-146-link -> /nix/store/yxpw1jdx3xf1k67xkfz08wzzc9iafb9m-nixos-system-nixpi-22.11pre414197.fd54651f5ff

Everything seems fine here :thinking:

Can you take a look at /boot/loader/loader.conf for the default line, and then look for this file in /boot/loader/entries/ and paste it. I’d like to know if grub is making you boot on yxpw1jdx3xf1k67xkfz08wzzc9iafb9m, but I don’t know how it could boot on something else as you have just on profile available.

That would start to be weird, but I suppose you don’t have two partitions mounted on / that could hide what’s going on? But as NixOS manages filesystems, I suppose it wouldn’t be possible to declare two root filesystem at the same time without having an error…

I dont have the loader folder in /boot:

extlinux             bcm2710-rpi-3-b-plus.dtb  bcm2837-rpi-3-a-plus.dtb  bootcode.bin  fixup4x.dat   kernel.img    start4db.elf  start_x.elf
nixos                bcm2710-rpi-cm3.dtb       bcm2837-rpi-3-b.dtb       cmdline.txt   fixup_cd.dat  nixos-init    start4.elf    u-boot-rpi3.bin
old                  bcm2710-rpi-zero-2.dtb    bcm2837-rpi-3-b-plus.dtb  config.txt    fixup.dat     pieeprom.sig  start4x.elf   u-boot-rpi4.bin
armstub8-gic.bin     bcm2711-rpi-400.dtb       bcm2837-rpi-cm3.dtb       fixup4cd.dat  fixup_db.dat  pieeprom.upd  start_cd.elf
bcm2710-rpi-2-b.dtb  bcm2711-rpi-4-b.dtb       bcm2837-rpi-zero-2.dtb    fixup4.dat    fixup_x.dat   RECOVERY.000  start_db.elf
bcm2710-rpi-3-b.dtb  bcm2711-rpi-cm4.dtb       bcm2838-rpi-4-b.dtb       fixup4db.dat  initrd        start4cd.elf  start.elf

I have the following regarding my boot loader in my hardware configuration:

  boot.loader.grub.enable = false;
  boot.loader.generic-extlinux-compatible.enable = true;

Oh, I don’t know how this boot loader works :confused: