From d3d3edd66461efe5a33317a58872d1ecee3e1aed Mon Sep 17 00:00:00 2001 From: Joshua Yuen Date: Mon, 29 Jun 2026 18:41:08 -0400 Subject: [PATCH] Add GNOME Boxes configuration --- hosts/laptop/default.nix | 2 ++ modules/core/default.nix | 1 + modules/core/gnomeBoxes.nix | 41 ++++++++++++++++++++++++++++++++++ modules/options/default.nix | 1 + modules/options/gnomeBoxes.nix | 13 +++++++++++ 5 files changed, 58 insertions(+) create mode 100644 modules/core/gnomeBoxes.nix create mode 100644 modules/options/gnomeBoxes.nix diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 07cd90d..65a8469 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -14,4 +14,6 @@ ]; modules.gpg.signingKey = "0x530DA0331EFE99F5"; + modules.gnomeBoxes.enable = true; + } diff --git a/modules/core/default.nix b/modules/core/default.nix index aed6fc1..8564c13 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -7,6 +7,7 @@ ./firefox.nix ./fonts.nix ./gdm.nix + ./gnomeBoxes.nix ./hyprland.nix ./localsend.nix ./network.nix diff --git a/modules/core/gnomeBoxes.nix b/modules/core/gnomeBoxes.nix new file mode 100644 index 0000000..921c62f --- /dev/null +++ b/modules/core/gnomeBoxes.nix @@ -0,0 +1,41 @@ +{ + config, + lib, + pkgs, + username, + ... +}: +with lib; +let + cfg = config.modules.gnomeBoxes; +in +{ + config = mkIf cfg.enable { + virtualisation = { + libvirtd = { + enable = true; + + # Enable TPM emulation (for Windows 11) + qemu = { + package = pkgs.qemu_kvm; + swtpm.enable = true; + }; + }; + + # Enable USD redirection + spiceUSBRedirection.enable = true; + }; + + # Allow VM management + users.groups.libvirtd.members = [ username ]; + users.groups.kvm.members = [ username ]; + + # Enable VM networking and file sharing + environment.systemPackages = with pkgs; [ + gnome-boxes + swtpm + dnsmasq + phodav + ]; + }; +} diff --git a/modules/options/default.nix b/modules/options/default.nix index 0c605fa..1e3e617 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -5,6 +5,7 @@ imports = [ ./discord.nix ./displayManager.nix + ./gnomeBoxes.nix ./gpg.nix ./hyprland.nix ./localsend.nix diff --git a/modules/options/gnomeBoxes.nix b/modules/options/gnomeBoxes.nix new file mode 100644 index 0000000..6770c7d --- /dev/null +++ b/modules/options/gnomeBoxes.nix @@ -0,0 +1,13 @@ +{ + lib, + ... +}: +with lib; +{ + options.modules.gnomeBoxes = { + enable = mkEnableOption { + default = false; + description = "Enable GNOME Boxes"; + }; + }; +}