- 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
31 lines
629 B
Nix
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
|
|
'';
|
|
};
|
|
}
|