nix-community / srvos

NixOS profiles for servers [maintainer=@numtide]
https://nix-community.github.io/srvos
MIT License
417 stars 16 forks source link

Problems with `system.switch.enableNg` #434

Closed mrVanDalo closed 1 month ago

mrVanDalo commented 1 month ago

I just updated srvos, but ran into problems :

$> nix flake lock --update-input srvos
warning: updating lock file '/home/palo/dev/nixos/nixos-config/flake.lock':
• Updated input 'srvos':
    'github:nix-community/srvos/5d4550de420ee501d7fa0e6cd9031cd00354554c' (2024-05-27)
  → 'github:nix-community/srvos/414d1039a58b667e4512ad9f7068aa935ebf8d59' (2024-05-30)
• Updated input 'srvos/nixpkgs':
    'github:NixOS/nixpkgs/b5995681aa319d0e33a6d83a31710d6c6f092820' (2024-05-26)
  → 'github:NixOS/nixpkgs/c598bbfe379934e8f379bc474cc1914a7c34fbdc' (2024-05-29)

$> clan machines update orbi
All secrets and facts are already up to date
...
[orbi] updating GRUB 2 menu...
[orbi] Error: Failed to load unit file /etc/systemd/system/zfs-import-zmedia.service
[orbi]
[orbi] Caused by:
[orbi]     3:39 unknown character in \xHH form
[orbi] warning: error(s) occurred while switching to the new configuration

setting

system.switch.enableNg = false;
system.switch.enable = true;

fixes the issue.

I couldn't find out which file contains the \xHH (in 3:39).

zimbatm commented 1 month ago

@mrVanDalo could you share the /etc/systemd/system/zfs-import-zmedia.service file? There might be some weirdness in there.

mrVanDalo commented 1 month ago

I try but I but it seems the switch is not happening, so I have to find out how to find the file.

mrVanDalo commented 1 month ago

Hmm the file is the same no mater what I configure (enableNg = true or false) (in /nix/var/nix/profile/system-**-link) zfs-import-zmedia.service.txt

Here is a hash to be sure it's the same file content.

sha256sum zfs-import-zmedia.service.txt
76b66cbf433224074a8747febccdf77f34cf828436ee9c9ac0d7ce7ca97c1471  zfs-import-zmedia.service.txt
mrVanDalo commented 1 month ago

https://github.com/NixOS/nixpkgs/issues/315602 < this looks like a similar issue.

Mic92 commented 1 month ago

Ok. So it should be fixed by https://github.com/NixOS/nixpkgs/pull/315680?

mrVanDalo commented 1 month ago

I guess so. I'll test tomorrow again and close this issue if it works. But we could also close it now and I reopen the issue if it fails.

Mic92 commented 1 month ago

Let's do that. I made sure it's also backported to 24.05. However I will probably only keep it enabled on nixos-unstable in srvos. All in all it feels snappier than the original implementation.

SuperSandro2000 commented 1 month ago

All in all it feels snappier than the original implementation.

I don't think that is based on the implementation. In the past when the switch took forever you usually waited for some unit which took a long time to get ready.