I’m moving from Gentoo on NixOS on my HTPC. I have things functionally working for the most part, but there are a still few loose ends I’m trying to figure out.
MY HTPC runs Kodi and plays media off a NAS, which I mount via NFS. Without the NFS mounts configured NixOS bots straight into an LXQt desktop running Kodi very quickly. However, when I enable the NFS mounts, there’s a ~30s delay right before loading the desktop. I’m trying to eliminate this delay (or at least shorten it as much as possible) as a short boot time is important for this use case.
Here’s how I have my NFS mounts defined:
fileSystems."/home/media/data/videos" =
{ device = "nas:/data/videos";
fsType = "nfs4";
options = [ "sec=sys" "x-systemd.automount" ];
};
dmesg shows this:
[ 5.789011] amdgpu 0000:0b:00.0: [drm] fb0: amdgpudrmfb frame buffer device
[ 6.403814] systemd-journald[600]: /var/log/journal/3f3740c629e741d68b35563971e25413/user-2000.journal: Journal file uses a different sequence number ID, rotating.
[ 6.855630] r8169 0000:08:00.0 enp8s0: Link is Up - 1Gbps/Full - flow control off
[ 7.380351] amdgpu 0000:0b:00.0: [drm] REG_WAIT timeout 1us * 100000 tries - optc1_wait_for_state line:839
[ 33.584138] netfs: FS-Cache loaded
[ 33.620828] Key type dns_resolver registered
[ 33.720606] NFS: Registering the id_resolver key type
[ 33.720612] Key type id_resolver registered
[ 33.720614] Key type id_legacy registered
while Xorg.0.log shows this:
[ 7.088] (--) AMDGPU(0): HDMI max TMDS frequency 300000KHz
[ 33.890] (II) AMDGPU(0): EDID vendor "DON", prod id 107
X starts loading approximately 6 seconds into the boot, and gets to the point where it displays a a mouse cursor, then just hangs for ~30 seconds. Right after that “netfs: FS-Cache loaded” is printed in dmesg, X finishes loading into LXQt.
Any suggestions on how I can reduce this delay?
Aside from being new to NixOS I’m also pretty new to systemd, so I’m struggling to narrow this down further. I’m guessing there’s a dependency on the NFS mount that’s blocking the desktop from loading until it complete, but I don’t know how or where that’s being enforced. Is there some way to disable that? The NFS mounts need to exist before I play media, but not before LXQt and Kodi loads. I tried adding “noauto” to the NFS options thinking that may have it perform the amount upon first access, but it didn’t make a difference.
Alternatively, I compared this to one of my other systems still running Gentoo. That netfs: FS-Cache line doesn’t appear in my started, and it seems I don’t even have that feature enabled in the kernel, so it’s not necessary for my use case. Is there some way to disable that in NixOS? I tried searching for info about this but came up empty.
Would appreciate any help. Thanks!