Archived
Two compounding bugs, confirmed live on the running lxc-docker
container (vmid 102 on pve.sweet.home):
1. x-systemd.automount never works inside any Linux container --
systemd logs "Starting of <unit>.automount unsupported" for every
share and never mounts them. modules/docker/mount-data.nix and
modules/raspi/mount-data.nix now key off config.boot.isContainer
(set true by nixpkgs' proxmox-lxc.nix) to mount eagerly with
`nofail` there instead, while VM-based docker targets keep automount
unchanged.
2. The container's Proxmox `features` never included `mount=nfs`, so
AppArmor blanket-denies the nfs/rpc_pipefs mount syscalls NFS
needs ("permission denied"). scripts/env.sh's
PROXMOX_DEFAULT_LXC_FEATURES now includes mount=nfs;nfs4 for future
lxc-* containers -- the semicolon required quoting the --features
value in create-proxmox-resource.sh's remote pct-create command,
since it's sent as a raw string for the remote shell to parse and an
unquoted `;` would be read as a command separator.
The already-running container needs a matching `pct set --features`
plus a restart to pick this up -- that's an operator step outside this
repo.
33 lines
913 B
Nix
33 lines
913 B
Nix
{ config, lib, vars, ... }:
|
|
|
|
{
|
|
fileSystems.${vars.raspiMountpoint} = {
|
|
device = "${vars.raspberryPiHost}.${vars.tailnetDomain}:${vars.raspiNfsPath}";
|
|
fsType = "nfs4";
|
|
options = [
|
|
"nofail"
|
|
"_netdev"
|
|
"noatime"
|
|
|
|
# Explicitly use NFSv4.2 if supported
|
|
"nfsvers=4.2"
|
|
] ++ lib.optionals (!config.boot.isContainer) [
|
|
# `x-systemd.automount` never works inside a Linux container (LXC
|
|
# included) -- confirmed live on lxc-docker: systemd logs "Starting
|
|
# of <unit>.automount unsupported" and never mounts it. `nofail`
|
|
# above already keeps boot non-blocking there, so plain eager
|
|
# mounting is fine.
|
|
|
|
# Don't mount until first access
|
|
"x-systemd.automount"
|
|
|
|
# Unmount after 10 min idle
|
|
"x-systemd.idle-timeout=600"
|
|
|
|
# Give the Pi/Tailscale a little time to appear
|
|
"x-systemd.device-timeout=10s"
|
|
];
|
|
};
|
|
|
|
}
|