From 5fb6b65d24de4147f06ce6d5b5a7be818e8368e1 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Mon, 5 Jun 2023 12:34:23 -0400 Subject: [PATCH] nix: Merge host modules --- common.nix | 62 +++++++++++++++++++++++++++++++++ host/mullvad/default.nix | 31 ----------------- host/networking/default.nix | 18 ---------- host/virtualization/default.nix | 16 --------- 4 files changed, 62 insertions(+), 65 deletions(-) delete mode 100644 host/mullvad/default.nix delete mode 100644 host/networking/default.nix delete mode 100644 host/virtualization/default.nix diff --git a/common.nix b/common.nix index de7b3234..39797e58 100644 --- a/common.nix +++ b/common.nix @@ -47,6 +47,7 @@ slade typespeed osu-lazer-bin + mullvad-vpn # dev marksman @@ -165,4 +166,65 @@ # dev programs.npm.enable = true; + + # networking + networking = { + hostName = "nixos"; + + networkmanager = { + enable = true; + dns = "none"; + wifi.macAddress = "random"; + ethernet.macAddress = "random"; + }; + + useHostResolvConf = true; + }; + + services.resolved.llmnr = "false"; + + systemd.services.NetworkManager-wait-online.enable = false; + + # virtualization + virtualisation.vmVariant = { + virtualisation = { + memorySize = 8192; + cores = 4; + restrictNetwork = true; + }; + + virtualisation.qemu.options = + [ "-device virtio-vga-gl" "-display sdl,gl=on,show-cursor=off" "-full-screen" ]; + + environment.sessionVariables = { + WLR_NO_HARDWARE_CURSORS = "1"; + }; + }; + + # mullvad-vpn + services.mullvad-vpn = { + enable = true; + enableExcludeWrapper = false; + }; + + networking.firewall.allowedTCPPorts = [ 11918 ]; + + networking = { + nat = { + enable = true; + internalInterfaces = [ "ve-+" ]; + externalInterface = "wg-mullvad"; + + forwardPorts = [ + { + destination = "192.168.100.11:80"; + sourcePort = 11918; + } + ]; + }; + + networkmanager = { + unmanaged = [ "interface-name:ve-*" ]; + }; + }; } diff --git a/host/mullvad/default.nix b/host/mullvad/default.nix deleted file mode 100644 index 9fe45d0b..00000000 --- a/host/mullvad/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ pkgs, ... }: - -{ - environment.systemPackages = [ pkgs.mullvad-vpn ]; - - services.mullvad-vpn = { - enable = true; - enableExcludeWrapper = false; - }; - - networking.firewall.allowedTCPPorts = [ 11918 ]; - - networking = { - nat = { - enable = true; - internalInterfaces = [ "ve-+" ]; - externalInterface = "wg-mullvad"; - - forwardPorts = [ - { - destination = "192.168.100.11:80"; - sourcePort = 11918; - } - ]; - }; - - networkmanager = { - unmanaged = [ "interface-name:ve-*" ]; - }; - }; -} diff --git a/host/networking/default.nix b/host/networking/default.nix deleted file mode 100644 index d68246ed..00000000 --- a/host/networking/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - networking = { - hostName = "nixos"; - - networkmanager = { - enable = true; - dns = "none"; - wifi.macAddress = "random"; - ethernet.macAddress = "random"; - }; - - useHostResolvConf = true; - }; - - services.resolved.llmnr = "false"; - - systemd.services.NetworkManager-wait-online.enable = false; -} diff --git a/host/virtualization/default.nix b/host/virtualization/default.nix deleted file mode 100644 index 552bbe4b..00000000 --- a/host/virtualization/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - virtualisation.vmVariant = { - virtualisation = { - memorySize = 8192; - cores = 4; - restrictNetwork = true; - }; - - virtualisation.qemu.options = - [ "-device virtio-vga-gl" "-display sdl,gl=on,show-cursor=off" "-full-screen" ]; - - environment.sessionVariables = { - WLR_NO_HARDWARE_CURSORS = "1"; - }; - }; -}