summaryrefslogtreecommitdiff
path: root/system/virt
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-09-17 22:07:16 -0400
committerFreya Murphy <freya@freyacat.org>2025-09-17 22:07:16 -0400
commit68d03fe362b7e0df11662d8d6a1e01eac0bfae77 (patch)
treea76abd05f662f73b4083ddb0d8bf0d72c29e5a74 /system/virt
parentupdate commits (diff)
downloaddotfiles-nix-68d03fe362b7e0df11662d8d6a1e01eac0bfae77.tar.gz
dotfiles-nix-68d03fe362b7e0df11662d8d6a1e01eac0bfae77.tar.bz2
dotfiles-nix-68d03fe362b7e0df11662d8d6a1e01eac0bfae77.zip
refactor: remove modules folder, fully split home and system modules
Diffstat (limited to 'system/virt')
-rw-r--r--system/virt/default.nix6
-rw-r--r--system/virt/docker.nix15
-rw-r--r--system/virt/qemu.nix21
3 files changed, 42 insertions, 0 deletions
diff --git a/system/virt/default.nix b/system/virt/default.nix
new file mode 100644
index 0000000..18be703
--- /dev/null
+++ b/system/virt/default.nix
@@ -0,0 +1,6 @@
+{...}: {
+ imports = [
+ ./docker.nix
+ ./qemu.nix
+ ];
+}
diff --git a/system/virt/docker.nix b/system/virt/docker.nix
new file mode 100644
index 0000000..2505df4
--- /dev/null
+++ b/system/virt/docker.nix
@@ -0,0 +1,15 @@
+{
+ lib,
+ config,
+ pkgs,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.virt.docker;
+in {
+ config = mkIf cfg.enable {
+ virtualisation.docker.enable = true;
+ virtualisation.docker.storageDriver = "btrfs";
+ users.groups.docker.members = [config.user];
+ };
+}
diff --git a/system/virt/qemu.nix b/system/virt/qemu.nix
new file mode 100644
index 0000000..6c068e4
--- /dev/null
+++ b/system/virt/qemu.nix
@@ -0,0 +1,21 @@
+{
+ lib,
+ config,
+ pkgs,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.virt.qemu;
+in {
+ config = mkIf cfg.enable {
+ programs.virt-manager.enable = true;
+ users.groups.kvm.members = [config.user];
+ users.groups.libvirtd.members = [config.user];
+ virtualisation.libvirtd.enable = true;
+ virtualisation.spiceUSBRedirection.enable = true;
+
+ environment.systemPackages = with pkgs; [
+ qemu
+ ];
+ };
+}