diff --git a/common/desktop/vnc.nix b/common/desktop/vnc.nix new file mode 100644 index 0000000..60225ff --- /dev/null +++ b/common/desktop/vnc.nix @@ -0,0 +1,17 @@ +{ pkgs, config, ...}: + +{ + services.xserver.enable = true; + services.xserver.displayManager.autoLogin = { + enable = true; + user = "regent"; + }; + + services.xserver.displayManager.sessionCommands = '' + ${pkgs.x11vnc}/bin/x11vnc -rfbauth $HOME/.vnc/passwd & + ''; + + services.xserver.desktopManager.xfce = { + enable = true; + } +}; diff --git a/flake.nix b/flake.nix index bbcf3d8..8c3f80a 100755 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,8 @@ url = "github:0xc000022070/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; + #microvm.url = "github:astro/microvm.nix"; + #microvm.inputs.nixpkgs.follows = "nixpkgs"; catppuccin.url = "github:catppuccin/nix"; home-manager = { @@ -46,6 +48,13 @@ ./hosts/focalor lix-module.nixosModules.default + /*microvm.nixosModules.host + { + microvm.autostart = [ + "windows" + ]; + }*/ + vscode-server.nixosModules.default agenix.nixosModules.default diff --git a/hosts/focalor/default.nix b/hosts/focalor/default.nix index 41e15fc..0ae05c4 100755 --- a/hosts/focalor/default.nix +++ b/hosts/focalor/default.nix @@ -6,6 +6,7 @@ # Host-specific hardware ./hardware.nix ./secrets.nix + ./vfio.nix # Common modules shared across hosts ../../common/system.nix @@ -16,6 +17,7 @@ # Desktop modules ../../common/desktop/core.nix ../../common/desktop/sway.nix + ../../common/desktop/vnc.nix # Nvidia ../../common/nvidia.nix @@ -34,7 +36,35 @@ networking.hostName = "focalor"; networking.hostId = "84bdc587"; - networking = { + systemd.network = { + enable = true; + netdevs."br0" = { + netdevConfig = { + Name = "br0"; + Kind = "bridge"; + }; + }; + networks = { + "10-lan" = { + matchConfig.Name = ["enp5s0" "vm-*"]; + networkConfig = { + Bridge = "br0"; + }; + }; + "10-lan-bridge" = { + matchConfig.Name = "br0"; + networkConfig = { + Address = ["10.0.0.34/24" "2601:5c2:8400:26c0:aaa1:59ff:fe94:5aba/64"]; + Gateway = "10.0.0.1"; + DNS = ["10.0.0.210" "1.1.1.1"]; + IPv6AcceptRA = true; + }; + linkConfig.RequiredForOnline = "routable"; + }; + }; + }; + + /*networking = { firewall.enable = false; firewall.trustedInterfaces = [ "tailscale0" @@ -42,7 +72,7 @@ nameservers = [ "10.0.0.210" "1.1.1.1" ]; useDHCP = true; firewall.allowedTCPPorts = [22 80 443 2456 2457 9000 9001 9002]; - }; + };*/ services.resolved = { enable = true; diff --git a/hosts/focalor/vfio.nix b/hosts/focalor/vfio.nix index e0d1cfa..eb144df 100644 --- a/hosts/focalor/vfio.nix +++ b/hosts/focalor/vfio.nix @@ -1,19 +1,23 @@ -programs.virt-manager.enable = true; -virtualisation.spiceUSBRedirection.enable = true; -virtualisation.libvirtd = { - enable = true; - qemu = { - package = pkgs.qemu_kvm; - runAsRoot = true; - swtpm.enable = true; - ovmf = { - enable = true; - packages = [(pkgs.OVMF.override { - secureBoot = true; - tpmSupport = true; - }).fd]; +{ config, lib, system, pkgs, modulesPath, inputs, ... }: + +{ + programs.virt-manager.enable = true; + virtualisation.spiceUSBRedirection.enable = true; + virtualisation.libvirtd = { + enable = true; + qemu = { + package = pkgs.qemu_kvm; + runAsRoot = true; + swtpm.enable = true; + ovmf = { + enable = true; + packages = [(pkgs.OVMF.override { + secureBoot = true; + tpmSupport = true; + }).fd]; + }; }; }; -}; -users.extraUsers.regent.extraGroups = [ "libvirtd" ]; \ No newline at end of file + users.extraUsers.regent.extraGroups = [ "libvirtd" ]; +} \ No newline at end of file