From 428ff5b4af1f2167164792dfddd514e162afe021 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sat, 11 Jan 2025 15:25:39 +0100 Subject: [PATCH] system.apps: Add qemu --- hosts/perso-desktop/configuration.nix | 1 + modules/system/apps/default.nix | 1 + modules/system/apps/qemu/default.nix | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 modules/system/apps/qemu/default.nix diff --git a/hosts/perso-desktop/configuration.nix b/hosts/perso-desktop/configuration.nix index 387988a..2355a87 100644 --- a/hosts/perso-desktop/configuration.nix +++ b/hosts/perso-desktop/configuration.nix @@ -34,6 +34,7 @@ apps = { flatpak.enable = true; steam.enable = true; + qemu.enable = true; }; desktop = { diff --git a/modules/system/apps/default.nix b/modules/system/apps/default.nix index 501551c..e61811f 100644 --- a/modules/system/apps/default.nix +++ b/modules/system/apps/default.nix @@ -3,6 +3,7 @@ { imports = [ ./flatpak + ./qemu ./steam ]; } diff --git a/modules/system/apps/qemu/default.nix b/modules/system/apps/qemu/default.nix new file mode 100644 index 0000000..2556846 --- /dev/null +++ b/modules/system/apps/qemu/default.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.modules.system.apps.qemu; +in +{ + options.modules.system.apps.qemu = { + enable = mkEnableOption '' + Enable qemu with my custom configurations + ''; + }; + config = mkIf cfg.enable { + programs.virt-manager.enable = true; + + users.groups.libvirtd.members = ["florian"]; + users.users.florian.extraGroups = [ "libvirtd" ]; + + virtualisation.libvirtd.enable = true; + + virtualisation.spiceUSBRedirection.enable = true; + }; +}