fix mounting

This commit is contained in:
Joshua Bell 2026-02-01 11:35:58 -06:00
parent 3b4f54984e
commit acca9fbf50

View file

@ -138,34 +138,36 @@
# virtiofs mount points for caches (must match qvm virtiofsd mount tags)
# Using virtiofs instead of 9p for better performance and hot-mount support
# Note: We use fileSystems with x-systemd options for proper ordering
# The mount waits for multi-user.target to ensure virtio-fs devices are ready
fileSystems."/cache/cargo" = {
device = "cargo_home";
fsType = "virtiofs";
options = [ "nofail" ];
options = [ "nofail" "x-systemd.automount" "x-systemd.idle-timeout=60" ];
};
fileSystems."/cache/target" = {
device = "cargo_target";
fsType = "virtiofs";
options = [ "nofail" ];
options = [ "nofail" "x-systemd.automount" "x-systemd.idle-timeout=60" ];
};
fileSystems."/cache/pnpm" = {
device = "pnpm_store";
fsType = "virtiofs";
options = [ "nofail" ];
options = [ "nofail" "x-systemd.automount" "x-systemd.idle-timeout=60" ];
};
fileSystems."/cache/sccache" = {
device = "sccache";
fsType = "virtiofs";
options = [ "nofail" ];
options = [ "nofail" "x-systemd.automount" "x-systemd.idle-timeout=60" ];
};
fileSystems."/root/.config/opencode" = {
device = "opencode_config";
fsType = "virtiofs";
options = [ "nofail" ];
options = [ "nofail" "x-systemd.automount" "x-systemd.idle-timeout=60" ];
};
# Environment variables for cache directories
@ -186,50 +188,9 @@
"d /cache/sccache 0755 root root -"
];
# Systemd mount units for cache directories using virtiofs
# virtiofs provides better performance than 9p and supports hot-mounting
systemd.mounts = [
{
what = "cargo_home";
where = "/cache/cargo";
type = "virtiofs";
options = "nofail";
wantedBy = [ "multi-user.target" ];
after = [ "systemd-modules-load.service" ];
}
{
what = "cargo_target";
where = "/cache/target";
type = "virtiofs";
options = "nofail";
wantedBy = [ "multi-user.target" ];
after = [ "systemd-modules-load.service" ];
}
{
what = "pnpm_store";
where = "/cache/pnpm";
type = "virtiofs";
options = "nofail";
wantedBy = [ "multi-user.target" ];
after = [ "systemd-modules-load.service" ];
}
{
what = "sccache";
where = "/cache/sccache";
type = "virtiofs";
options = "nofail";
wantedBy = [ "multi-user.target" ];
after = [ "systemd-modules-load.service" ];
}
{
what = "opencode_config";
where = "/root/.config/opencode";
type = "virtiofs";
options = "nofail";
wantedBy = [ "multi-user.target" ];
after = [ "systemd-modules-load.service" ];
}
];
# NOTE: Mount configuration is handled via fileSystems above with x-systemd.automount
# This provides on-demand mounting when the directory is first accessed,
# avoiding timing issues with virtiofs device availability at boot
# Essential packages for development
environment.systemPackages = with pkgs; [