From bb62b20c4b4b2f06531c0ad7230724187053e2c4 Mon Sep 17 00:00:00 2001 From: catvayor Date: Mon, 15 Apr 2024 09:17:59 +0200 Subject: [PATCH] random changes --- hive.nix | 7 ++++-- machines/kat-probook/configuration.nix | 3 +-- machines/kat-probook/router.nix | 31 ++++++++++++++++++++++++++ modules/zsh.nix | 1 + 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 machines/kat-probook/router.nix diff --git a/hive.nix b/hive.nix index 454058c..2bd2c37 100644 --- a/hive.nix +++ b/hive.nix @@ -59,7 +59,7 @@ in { }; BOcal = { - deployment.targetHost = "192.168.222.1"; + deployment.targetHost = "bocal.tmp"; imports = [ ./BOcal/configuration.nix ]; users.users.root.openssh.authorizedKeys.keys = [ @@ -88,6 +88,8 @@ in { boot.supportedFilesystems = [ "bcachefs" ]; programs.zsh.enable = true; services.openssh.enable = true; + services.qemuGuest.enable = true; + boot.kernelParams = [ "console=ttyS0" ]; environment.etc = { "config_base.nix" = { @@ -108,7 +110,8 @@ in { font = "Lat2-Terminus16"; keyMap = "fr"; }; - services.netbird.enable = true; + #services.netbird.enable = true; + services.qemuGuest.enable = true; services.openssh.enable = true; users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAA16foz+XzwKwyIR4wFgNIAE3Y7AfXyEsUZFVVz8Rie catvayor@katvayor" diff --git a/machines/kat-probook/configuration.nix b/machines/kat-probook/configuration.nix index f23116e..7abfabd 100644 --- a/machines/kat-probook/configuration.nix +++ b/machines/kat-probook/configuration.nix @@ -6,6 +6,7 @@ imports = [ ./hardware-configuration.nix + # ./router.nix ]; boot.loader.systemd-boot.enable = true; @@ -54,8 +55,6 @@ # Define a user account. Don't forget to set a password with ‘passwd’. programs.zsh.enable = true; - boot.kernel.sysctl."net.ipv4.ip_forward" = true; - environment.systemPackages = with pkgs; [ wget brightnessctl diff --git a/machines/kat-probook/router.nix b/machines/kat-probook/router.nix new file mode 100644 index 0000000..96a260c --- /dev/null +++ b/machines/kat-probook/router.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: { + boot.kernel.sysctl."net.ipv4.ip_forward" = true; + + systemd.network = { + enable = true; + networks = { + "uplink" = { + name = "wlp0s20f3"; + DHCP = "ipv4"; + networkConfig.IPMasquerade = "ipv4"; + }; + "10-enp2s0" = { + name = "enp2s0"; + address = [ "192.168.2.1/24" ]; + networkConfig.DHCPServer = "yes"; + # dhcpServerConfig = { + # PoolOffset = 100; + # PoolSize = 100; + # BootServerAddress = "192.168.222.1"; + # }; + }; + }; + }; + + networking.nat = { + enable = true; + internalInterfaces = [ "enp2s0" ]; + externalInterface = "wlp0s20f3"; + }; + networking.firewall.allowedUDPPorts = [ 67 ]; +} diff --git a/modules/zsh.nix b/modules/zsh.nix index 6f49988..73bf015 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -43,5 +43,6 @@ programs.starship = { enable = true; enableZshIntegration = true; + settings.battery.disabled = true; }; }