From fd78a2b3a2352866d7b3f44d857ecde7e3aeaef7 Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Mon, 18 Aug 2025 13:07:20 -0400 Subject: [PATCH] Virtualize elara Signed-off-by: Nikolaos Karaolidis --- .../configs/system/cloudflared/default.nix | 5 ---- hosts/elara/configs/globalprotect/default.nix | 29 ------------------ hosts/elara/default.nix | 6 ---- hosts/elara/hardware/default.nix | 24 +++++++-------- hosts/elara/hardware/display.nix | 27 +++++++++++++++++ hosts/elara/hardware/sas/default.nix | 28 ----------------- hosts/elara/hardware/sas/display.nix | 30 ------------------- hosts/elara/hardware/sas/keybinds.nix | 15 ---------- hosts/elara/users/nikara/default.nix | 2 -- submodules/sas | 2 +- submodules/secrets | 2 +- 11 files changed, 40 insertions(+), 130 deletions(-) delete mode 100644 hosts/common/configs/system/cloudflared/default.nix delete mode 100644 hosts/elara/configs/globalprotect/default.nix create mode 100644 hosts/elara/hardware/display.nix delete mode 100644 hosts/elara/hardware/sas/default.nix delete mode 100644 hosts/elara/hardware/sas/display.nix delete mode 100644 hosts/elara/hardware/sas/keybinds.nix diff --git a/hosts/common/configs/system/cloudflared/default.nix b/hosts/common/configs/system/cloudflared/default.nix deleted file mode 100644 index 68f6320..0000000 --- a/hosts/common/configs/system/cloudflared/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: -{ - # https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/ - services.cloudflared.enable = true; -} diff --git a/hosts/elara/configs/globalprotect/default.nix b/hosts/elara/configs/globalprotect/default.nix deleted file mode 100644 index 7b6a7c1..0000000 --- a/hosts/elara/configs/globalprotect/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, inputs, ... }: -{ - sops.secrets = { - "globalprotect/email".sopsFile = "${inputs.secrets}/domains/sas/secrets.yaml"; - "globalprotect/gateway".sopsFile = "${inputs.secrets}/domains/sas/secrets.yaml"; - "globalprotect/ssh/key".sopsFile = "${inputs.secrets}/domains/sas/secrets.yaml"; - "ntfy/username".sopsFile = "${inputs.secrets}/domains/sas/secrets.yaml"; - "ntfy/password".sopsFile = "${inputs.secrets}/domains/sas/secrets.yaml"; - }; - - sas.globalprotect = { - enable = true; - - email.file = config.sops.secrets."globalprotect/email".path; - gateway.file = config.sops.secrets."globalprotect/gateway".path; - - sish = { - host = "karaolidis.com"; - port = "2222"; - keyFile = config.sops.secrets."globalprotect/ssh/key".path; - }; - - ntfy = { - url = "https://ntfy.karaolidis.com/sas"; - username.file = config.sops.secrets."ntfy/username".path; - password.file = config.sops.secrets."ntfy/password".path; - }; - }; -} diff --git a/hosts/elara/default.nix b/hosts/elara/default.nix index 89955e8..c68710d 100644 --- a/hosts/elara/default.nix +++ b/hosts/elara/default.nix @@ -18,19 +18,15 @@ ../common/configs/system - ../common/configs/system/bluetooth ../common/configs/system/boot - ../common/configs/system/brightnessctl ../common/configs/system/btrbk ../common/configs/system/btrfs - ../common/configs/system/cloudflared ../common/configs/system/dnsmasq ../common/configs/system/documentation ../common/configs/system/getty ../common/configs/system/git ../common/configs/system/gpg-agent ../common/configs/system/impermanence - ../common/configs/system/lanzaboote ../common/configs/system/libvirt ../common/configs/system/neovim ../common/configs/system/networkmanager @@ -45,7 +41,6 @@ ../common/configs/system/podman ../common/configs/system/power ../common/configs/system/printing - ../common/configs/system/smartmontools ../common/configs/system/sops ../common/configs/system/ssh ../common/configs/system/sudo @@ -56,7 +51,6 @@ ../common/configs/system/users ../common/configs/system/zsh - ./configs/globalprotect ./configs/nix ./configs/pki ./configs/ssh diff --git a/hosts/elara/hardware/default.nix b/hosts/elara/hardware/default.nix index b423660..c80c650 100644 --- a/hosts/elara/hardware/default.nix +++ b/hosts/elara/hardware/default.nix @@ -1,19 +1,17 @@ { ... }: { - boot.initrd.kernelModules = [ - "xhci_pci" - "uas" - "sd_mod" - ]; + imports = [ ./display.nix ]; - services.tlp.settings.DISK_DEVICES = "sda"; + hardware = { + enableAllFirmware = true; - # By default, this host runs on an external SSD attached to himalia... - imports = [ ../../himalia/hardware ]; - - # ...but it can also run attached to a SAS-provided laptop. - specialisation.sas.configuration = { - disabledModules = [ ../../himalia/hardware ]; - imports = [ ./sas ]; + cpu = { + cores = 12; + threads = 12; + }; }; + + virtualisation.hypervGuest.enable = true; + + services.fstrim.enable = true; } diff --git a/hosts/elara/hardware/display.nix b/hosts/elara/hardware/display.nix new file mode 100644 index 0000000..07a31af --- /dev/null +++ b/hosts/elara/hardware/display.nix @@ -0,0 +1,27 @@ +{ ... }: +{ + boot.kernelParams = [ "video=hyperv_fb:1920x1200@60" ]; + + home-manager.sharedModules = [ + { + wayland.windowManager.hyprland.settings = { + monitor = [ "Virtual-1, preferred, 0x0, 1" ]; + + workspace = [ + "1, monitor:Virtual-1, layoutopt:orientation:left" + "2, monitor:Virtual-1, layoutopt:orientation:left" + "3, monitor:Virtual-1, layoutopt:orientation:left" + "4, monitor:Virtual-1, layoutopt:orientation:left" + "5, monitor:Virtual-1, layoutopt:orientation:left" + "6, monitor:Virtual-1, layoutopt:orientation:left" + "7, monitor:Virtual-1, layoutopt:orientation:left" + "8, monitor:Virtual-1, layoutopt:orientation:left" + "9, monitor:Virtual-1, layoutopt:orientation:left" + "10, monitor:Virtual-1, layoutopt:orientation:left" + ]; + }; + + programs.vscode.profiles.default.userSettings."window.zoomLevel" = (1.25 - 1) / 0.2; + } + ]; +} diff --git a/hosts/elara/hardware/sas/default.nix b/hosts/elara/hardware/sas/default.nix deleted file mode 100644 index 90ac457..0000000 --- a/hosts/elara/hardware/sas/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ ... }: -{ - imports = [ - ./display.nix - ./keybinds.nix - ]; - - hardware = { - enableAllFirmware = true; - - cpu = { - cores = 8; - threads = 12; - intel.updateMicrocode = true; - }; - }; - - boot = { - kernelModules = [ "kvm-intel" ]; - initrd.kernelModules = [ - "thunderbolt" - "vmd" - "nvme" - ]; - }; - - services.fstrim.enable = true; -} diff --git a/hosts/elara/hardware/sas/display.nix b/hosts/elara/hardware/sas/display.nix deleted file mode 100644 index 17cca3b..0000000 --- a/hosts/elara/hardware/sas/display.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ ... }: -{ - boot.kernelParams = [ "video=eDP-1:1920x1200@60" ]; - - home-manager.sharedModules = [ - { - wayland.windowManager.hyprland.settings = { - monitor = [ - "eDP-1, preferred, 0x0, 1" - ", maxwidth, auto-center-up, 1" - ]; - - workspace = [ - "1, monitor:eDP-1, layoutopt:orientation:left" - "2, monitor:eDP-1, layoutopt:orientation:left" - "3, monitor:eDP-1, layoutopt:orientation:left" - "4, monitor:eDP-1, layoutopt:orientation:left" - "5, monitor:eDP-1, layoutopt:orientation:left" - "6, monitor:eDP-1, layoutopt:orientation:left" - "7, monitor:eDP-1, layoutopt:orientation:left" - "8, monitor:eDP-1, layoutopt:orientation:left" - "9, monitor:eDP-1, layoutopt:orientation:left" - "10, monitor:eDP-1, layoutopt:orientation:left" - ]; - }; - - programs.vscode.profiles.default.userSettings."window.zoomLevel" = (1.25 - 1) / 0.2; - } - ]; -} diff --git a/hosts/elara/hardware/sas/keybinds.nix b/hosts/elara/hardware/sas/keybinds.nix deleted file mode 100644 index c176067..0000000 --- a/hosts/elara/hardware/sas/keybinds.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ lib, pkgs, ... }: -{ - home-manager.sharedModules = [ - { - wayland.windowManager.hyprland.settings.bindle = - let - brightnessctl = lib.meta.getExe pkgs.brightnessctl; - in - [ - ", XF86MonBrightnessUp, exec, ${brightnessctl} -q s 5%+" - ", XF86MonBrightnessDown, exec, ${brightnessctl} -q s 5%-" - ]; - } - ]; -} diff --git a/hosts/elara/users/nikara/default.nix b/hosts/elara/users/nikara/default.nix index 6960624..e3ee91a 100644 --- a/hosts/elara/users/nikara/default.nix +++ b/hosts/elara/users/nikara/default.nix @@ -15,7 +15,6 @@ in (import ../../../common/configs/user { inherit user home; }) (import ../../../common/configs/user/console/android { inherit user home; }) - (import ../../../common/configs/user/console/brightnessctl { inherit user home; }) (import ../../../common/configs/user/console/btop { inherit user home; }) (import ../../../common/configs/user/console/dive { inherit user home; }) (import ../../../common/configs/user/console/fastfetch { inherit user home; }) @@ -62,7 +61,6 @@ in (import ../../../common/configs/user/gui/feh { inherit user home; }) (import ../../../common/configs/user/gui/firefox { inherit user home; }) (import ../../../common/configs/user/gui/gtk { inherit user home; }) - (import ../../../common/configs/user/gui/hypridle { inherit user home; }) (import ../../../common/configs/user/gui/hyprland { inherit user home; }) (import ../../../common/configs/user/gui/hyprpicker { inherit user home; }) (import ../../../common/configs/user/gui/hyprshot { inherit user home; }) diff --git a/submodules/sas b/submodules/sas index ebe2f98..b01f3f8 160000 --- a/submodules/sas +++ b/submodules/sas @@ -1 +1 @@ -Subproject commit ebe2f986fc82df849d879f5b0af403c78ead2002 +Subproject commit b01f3f8456903cb1bde9637cc23b456b47354138 diff --git a/submodules/secrets b/submodules/secrets index c1a835c..646c6d8 160000 --- a/submodules/secrets +++ b/submodules/secrets @@ -1 +1 @@ -Subproject commit c1a835c4f9ba9915671c79b3241f4d4863f11323 +Subproject commit 646c6d87251e4562aa7b416c438225718746bb8e