Cleanup nixos-hypervisor host configs

This commit is contained in:
Théo Barnouin 2024-09-10 13:34:40 +02:00
parent dd216b9cab
commit 5ba440316a
2 changed files with 42 additions and 55 deletions

View file

@ -1,46 +1,58 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ imports = { imports = [ ./hardware-configuration.nix ];
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.settings = { nix = {
experimental-features = [ "nix-command" "flakes" ]; settings = {
trusted-users = [ "@wheel" ]; experimental-features = [ "nix-command" "flakes" ];
trusted-users = [ "@wheel" ];
auto-optimise-store = true;
};
gc = {
automatic = true;
dates = "daily";
options = "--delete older-than 3d";
};
}; };
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
networking.useNetworkd = true; networking= {
useNetworkd = true;
systemd.network.enable = true; firewall.allowedTCPPorts = [ 22 ];
systemd.network.networks."10-lan" = {
matchConfig.Name = ["enp1s0" "vm-*"];
networkConfig = {
Bridge = "br0";
};
}; };
systemd.network.netdevs."br0" = { systemd.network = {
netdevConfig = { enable = true;
Name = "br0"; netdevs."br0" = {
Kind = "bridge"; netdevConfig = {
Name = "br0";
Kind = "bridge";
};
}; };
}; networks = {
"10-lan" = {
systemd.network.networks."10-lan-bridge" = { matchConfig.Name = ["enp1s0" "vm-*"];
matchConfig.Name = "br0"; networkConfig = {
networkConfig = { Bridge = "br0";
Address = ["192.168.122.31/24"]; };
Gateway = "192.168.122.1"; };
DNS = ["192.168.122.1"]; "10-lan-bridge" = {
IPv6AcceptRA = true; matchConfig.Name = "br0";
networkConfig = {
Address = ["192.168.122.31/24"];
Gateway = "192.168.122.1";
DNS = ["192.168.122.1"];
IPv6AcceptRA = true;
};
linkConfig.RequiredForOnline = "routable";
};
}; };
linkConfig.RequiredForOnline = "routable";
}; };
time.timeZone = "Europe/Paris"; time.timeZone = "Europe/Paris";
i18n.defaultLocale = "fr_FR.UTF-8"; console = { i18n.defaultLocale = "fr_FR.UTF-8";
console = {
useXkbConfig = true; # use xkb.options in tty. useXkbConfig = true; # use xkb.options in tty.
}; };
@ -88,12 +100,6 @@
}; };
}; };
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 22 ];
#networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether. networking.firewall.enable = false;
system.stateVersion = "24.05"; # Did you read the comment? system.stateVersion = "24.05"; # Did you read the comment?
} }

View file

@ -21,7 +21,6 @@
vim-airline-themes vim-airline-themes
vim-bufferline vim-bufferline
vim-markdown vim-markdown
markdown-preview-nvim
tabular tabular
]; ];
settings = { settings = {
@ -73,9 +72,6 @@
# Nixos # Nixos
update = "sudo nixos-rebuild switch"; update = "sudo nixos-rebuild switch";
upgrade = "sudo nix-channel --update && sudo nixos-rebuild switch --upgrade"; upgrade = "sudo nix-channel --update && sudo nixos-rebuild switch --upgrade";
# Kitty
#ssh = "kitten ssh";
icat = "kitten icat";
}; };
oh-my-zsh = { oh-my-zsh = {
enable = true; enable = true;
@ -92,21 +88,6 @@
]; ];
theme = "bira"; theme = "bira";
}; };
initExtra = ''
export MAMBA_EXE="/etc/profiles/per-user/tbarnouin/bin/micromamba";
export MAMBA_ROOT_PREFIX="/home/tbarnouin/micromamba";
__mamba_setup="$("$MAMBA_EXE" shell hook --shell zsh --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
else
if [ -f "/home/tbarnouin/micromamba/etc/profile.d/micromamba.sh" ]; then
. "/home/tbarnouin/micromamba/etc/profile.d/micromamba.sh"
else
export PATH="/home/tbarnouin/micromamba/bin:$PATH"
fi
fi
unset __mamba_setup
'';
}; };
tmux = { tmux = {
enable = true; enable = true;