nixos-hypervisor/systems/minimalLXCConfig.nix

138 lines
2.7 KiB
Nix
Raw Normal View History

2024-12-12 17:19:28 +01:00
{
2025-01-23 14:13:19 +01:00
config,
pkgs,
lib,
inputs,
modulesPath,
...
}: {
2024-12-12 17:19:28 +01:00
nix = {
2025-01-23 14:13:19 +01:00
settings.experimental-features = ["nix-command" "flakes"];
settings.trusted-users = ["root" "@wheel"];
2024-12-12 17:19:28 +01:00
};
networking = {
firewall = {
enable = true;
2025-01-23 14:13:19 +01:00
allowedTCPPorts = [22 9002];
2024-12-12 17:19:28 +01:00
};
};
boot.isContainer = true;
proxmoxLXC = {
enable = true;
privileged = false;
manageNetwork = false;
manageHostName = false;
};
systemd.suppressedSystemUnits = [
"dev-mqueue.mount"
"sys-kernel-debug.mount"
"sys-fs-fuse-connections.mount"
];
time.timeZone = "Europe/Paris";
console.keyMap = "fr";
i18n.defaultLocale = "fr_FR.UTF-8";
environment.sessionVariables = rec {
2025-01-23 14:13:19 +01:00
TERM = "xterm-256color";
2024-12-12 17:19:28 +01:00
};
nix.gc = {
automatic = true;
dates = "daily";
options = "--delete-old";
};
security.sudo.wheelNeedsPassword = false;
users = {
users.tbarnouin = {
isNormalUser = true;
2025-01-23 14:13:19 +01:00
extraGroups = ["wheel"];
2024-12-12 17:19:28 +01:00
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICf1B0nxNMvPWSR9pStdtx2x6Iw+JUeCCt1CKWoD8dsr"
];
};
users.root = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
];
};
};
programs = {
zsh = {
enable = true;
shellAliases = {
ll = "ls -l";
lla = "ls -lah";
};
ohMyZsh = {
enable = true;
2025-01-23 14:13:19 +01:00
plugins = ["git"];
2024-12-12 17:19:28 +01:00
theme = "bira";
};
};
tmux = {
enable = true;
};
};
nixpkgs.config.allowUnfree = true;
environment = {
localBinInPath = true;
2025-01-23 14:13:19 +01:00
systemPackages = with pkgs; [
vim
bash
wget
curl
git
htop
tree
dig
ncdu
nmap
iperf3
netcat-openbsd
];
};
2024-12-12 17:19:28 +01:00
services = {
openssh = {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "prohibit-password";
hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
];
};
fail2ban = {
enable = true;
};
rsyslogd = {
enable = true;
extraConfig = "*.*@192.168.1.27:514;RSYSLOG_SyslogProtocol23Format";
};
prometheus = {
exporters = {
node = {
enable = true;
2025-01-23 14:13:19 +01:00
enabledCollectors = ["systemd"];
2024-12-12 17:19:28 +01:00
port = 9002;
};
};
};
};
system = {
2025-01-08 10:02:38 +01:00
stateVersion = "24.11";
2024-12-12 17:19:28 +01:00
activationScripts.ensure-ssh-key-dir.text = "mkdir -p /etc/ssh";
};
}