Files
nixos-configs/roles/nfs-mounts/default.nix
T
johno 1ecc3302b1
CI / check (push) Successful in 8m3s
CI / Build & Push OpenClaw Image (push) Successful in 36m2s
CI / build-and-cache (push) Failing after 1h4m39s
fix(nfs-mounts): add network and systemd mount options
Add _netdev, x-systemd.requires/after network-online.target,
x-systemd.automatic-mount=force, and x-systemd.mount-timeout=90
to improve NFS mount reliability on boot and network changes.
2026-05-11 18:10:29 -07:00

51 lines
1.2 KiB
Nix

{ config, lib, ... }:
with lib;
let
cfg = config.roles.nfs-mounts;
in
{
options.roles.nfs-mounts = {
enable = mkEnableOption "Enable default NFS mounts";
server = mkOption {
type = types.str;
default = "10.0.0.43";
description = "IP address or hostname of the NFS server";
};
remotePath = mkOption {
type = types.str;
default = "/media";
description = "Remote path to mount from the NFS server";
};
mountPoint = mkOption {
type = types.str;
default = "/media";
description = "Local mount point for the NFS share";
};
# TODO: implement requireMount
requireMount = mkOption {
type = types.bool;
description = "Hard fail if the NFS mounts are not available";
default = false;
};
};
config = mkIf cfg.enable {
fileSystems.${cfg.mountPoint} = {
device = "${cfg.server}:${cfg.remotePath}";
fsType = "nfs";
options = [
"defaults"
"nofail"
"softreval"
"_netdev"
"x-systemd.requires=network-online.target"
"x-systemd.after=network-online.target"
"x-systemd.automatic-mount=force"
"x-systemd.mount-timeout=90"
];
};
};
}