diff --git a/hosts/nixos-hypervisor/configuration.nix b/hosts/nixos-hypervisor/configuration.nix index 7d5857f..b13a14e 100644 --- a/hosts/nixos-hypervisor/configuration.nix +++ b/hosts/nixos-hypervisor/configuration.nix @@ -1,46 +1,58 @@ { config, lib, pkgs, ... }: -{ imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; +{ imports = [ ./hardware-configuration.nix ]; - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - trusted-users = [ "@wheel" ]; + nix = { + settings = { + 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; - networking.useNetworkd = true; - - systemd.network.enable = true; - systemd.network.networks."10-lan" = { - matchConfig.Name = ["enp1s0" "vm-*"]; - networkConfig = { - Bridge = "br0"; - }; + networking= { + useNetworkd = true; + firewall.allowedTCPPorts = [ 22 ]; }; - systemd.network.netdevs."br0" = { - netdevConfig = { - Name = "br0"; - Kind = "bridge"; + systemd.network = { + enable = true; + netdevs."br0" = { + netdevConfig = { + Name = "br0"; + Kind = "bridge"; + }; }; - }; - - systemd.network.networks."10-lan-bridge" = { - matchConfig.Name = "br0"; - networkConfig = { - Address = ["192.168.122.31/24"]; - Gateway = "192.168.122.1"; - DNS = ["192.168.122.1"]; - IPv6AcceptRA = true; + networks = { + "10-lan" = { + matchConfig.Name = ["enp1s0" "vm-*"]; + networkConfig = { + Bridge = "br0"; + }; + }; + "10-lan-bridge" = { + 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"; - i18n.defaultLocale = "fr_FR.UTF-8"; console = { + i18n.defaultLocale = "fr_FR.UTF-8"; + console = { 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? } - diff --git a/hosts/nixos-hypervisor/home.nix b/hosts/nixos-hypervisor/home.nix index 9550c95..e88fe0b 100644 --- a/hosts/nixos-hypervisor/home.nix +++ b/hosts/nixos-hypervisor/home.nix @@ -21,7 +21,6 @@ vim-airline-themes vim-bufferline vim-markdown - markdown-preview-nvim tabular ]; settings = { @@ -73,9 +72,6 @@ # Nixos update = "sudo nixos-rebuild switch"; upgrade = "sudo nix-channel --update && sudo nixos-rebuild switch --upgrade"; - # Kitty - #ssh = "kitten ssh"; - icat = "kitten icat"; }; oh-my-zsh = { enable = true; @@ -92,21 +88,6 @@ ]; 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 = { enable = true;