Files
nixos/hosts/nixos-lxc/configuration.nix
luochen570 a2bd672cf7 refactor: move sudo to core, lxc SSH to profile, clean up old lxc config
- sudo (wheelNeedsPassword) → modules/core/core.nix (全局)
- LXC SSH override (PermitRootLogin, PasswordAuth) → profiles/lxc.nix
- modules/server/ssh.nix: use mkDefault so profiles can override
- Delete modules/optional/lxc.nix
- Clean up hosts/nixos-lxc/configuration.nix: remove redundant SSH/sudo/users
  (now handled by core + server + profile chain)
- Update modules/optional/README.md
2026-05-27 06:47:50 +08:00

31 lines
629 B
Nix

{ modulesPath, ... }:
{
imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix")
];
# 修复 LXC 挂载报错
systemd.mounts = [
{ where = "/sys/kernel/debug"; enable = false; }
{ where = "/sys/fs/fuse/connections"; enable = false; }
];
systemd.services."sys-kernel-debug.mount".enable = false;
# 容器运行时设置
nix.settings.sandbox = false;
proxmoxLXC = {
manageNetwork = false;
privileged = true;
};
# 由宿主机处理 fstrim
services.fstrim.enable = false;
services.resolved = {
extraConfig = ''
Cache=true
CacheFromLocalhost=true
'';
};
}