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
This commit is contained in:
luochen570
2026-05-27 06:47:50 +08:00
parent d9b2204f19
commit a2bd672cf7
4 changed files with 16 additions and 28 deletions

View File

@@ -21,32 +21,10 @@
# 由宿主机处理 fstrim
services.fstrim.enable = false;
services.openssh = {
enable = true;
openFirewall = true;
settings = {
PermitRootLogin = "yes";
PasswordAuthentication = true;
};
};
# 用户账户配置
users.users.luochen570 = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
};
security.sudo.wheelNeedsPassword = false;
services.resolved = {
extraConfig = ''
Cache=true
CacheFromLocalhost=true
'';
};
nix.settings.substituters = [ "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" ];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "25.05";
}