nixos-hypervisor/hosts/nixmox-perseverance/configuration.nix

109 lines
2.2 KiB
Nix
Raw Permalink Normal View History

2024-09-09 10:48:56 +02:00
{ config, lib, pkgs, ... }:
2024-09-10 13:34:40 +02:00
{ imports = [ ./hardware-configuration.nix ];
2024-09-09 10:48:56 +02:00
2024-09-10 13:34:40 +02:00
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
trusted-users = [ "@wheel" ];
auto-optimise-store = true;
};
gc = {
automatic = true;
dates = "daily";
options = "--delete older-than 3d";
};
2024-09-09 10:48:56 +02:00
};
2024-09-10 13:34:40 +02:00
security.sudo.wheelNeedsPassword = false;
2024-09-10 09:51:13 +02:00
2024-09-10 13:34:40 +02:00
networking= {
useNetworkd = true;
firewall.allowedTCPPorts = [ 22 ];
2024-09-09 10:48:56 +02:00
};
2024-09-10 13:34:40 +02:00
systemd.network = {
enable = true;
netdevs."br0" = {
netdevConfig = {
Name = "br0";
Kind = "bridge";
};
2024-09-09 10:48:56 +02:00
};
2024-09-10 13:34:40 +02:00
networks = {
"10-lan" = {
matchConfig.Name = ["ens18" "vm-*"];
2024-09-10 13:34:40 +02:00
networkConfig = {
Bridge = "br0";
};
};
"10-lan-bridge" = {
matchConfig.Name = "br0";
networkConfig = {
2024-09-17 18:38:40 +02:00
Address = ["192.168.1.66/24"];
Gateway = "192.168.1.254";
DNS = ["192.168.1.254"];
2024-09-10 13:34:40 +02:00
IPv6AcceptRA = true;
};
linkConfig.RequiredForOnline = "routable";
};
2024-09-09 10:48:56 +02:00
};
};
time.timeZone = "Europe/Paris";
2024-09-10 13:34:40 +02:00
i18n.defaultLocale = "fr_FR.UTF-8";
console = {
2024-09-09 10:48:56 +02:00
useXkbConfig = true; # use xkb.options in tty.
};
users.users = {
tbarnouin = {
isNormalUser = true;
description = "Théo Barnouin";
extraGroups = [
"networkmanager"
"wheel"
"libvirtd"
"docker"
"render"
"video"
];
2024-09-10 09:51:13 +02:00
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
2024-09-09 10:48:56 +02:00
];
};
2024-09-10 09:51:13 +02:00
root = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
2024-09-09 10:48:56 +02:00
];
};
};
2024-09-10 09:51:13 +02:00
2024-09-09 10:48:56 +02:00
environment.systemPackages = with pkgs; [
2024-09-10 09:51:13 +02:00
vim
2024-09-09 10:48:56 +02:00
htop
wget
2024-09-10 09:51:13 +02:00
curl
2024-09-09 10:48:56 +02:00
git
neofetch
libvirt
qemu_kvm
nmap
];
services = {
openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
X11Forwarding = false;
PermitRootLogin = "prohibit-password";
};
2024-09-09 10:48:56 +02:00
};
qemuGuest.enable = true;
2024-09-09 10:48:56 +02:00
};
2025-01-08 10:02:38 +01:00
system.stateVersion = "24.11"; # Did you read the comment?
2024-09-09 10:48:56 +02:00
}