From 9af5ef490cd4d9eb2e7114233384977033e6c0be Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Mon, 11 Dec 2023 07:36:33 -0700 Subject: [PATCH] framework: Enable QEMU. --- hive/framework/configuration.nix | 13 ++++++++----- hive/framework/default.nix | 14 +++++++++++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/hive/framework/configuration.nix b/hive/framework/configuration.nix index 1ce554a..b16efb2 100644 --- a/hive/framework/configuration.nix +++ b/hive/framework/configuration.nix @@ -75,10 +75,13 @@ time.timeZone = "America/Denver"; - virtualisation.docker.rootless = { - enable = true; - # Sets the `DOCKER_HOST` variable to the rootless Docker instance for normal - # users by default. - setSocketVariable = true; + virtualisation = { + libvirtd.enable = true; + docker.rootless = { + enable = true; + # Sets the `DOCKER_HOST` variable to the rootless Docker instance for normal + # users by default. + setSocketVariable = true; + }; }; } diff --git a/hive/framework/default.nix b/hive/framework/default.nix index e1872f7..083fafd 100644 --- a/hive/framework/default.nix +++ b/hive/framework/default.nix @@ -11,7 +11,14 @@ useUserPackages = true; users.jrpotter = args@{ pkgs, lib, ... }: let - base = import ../../users/jrpotter args; + base = import ../../users/jrpotter args // { + dconf.settings = { + "org/virt-manager/virt-manager/connections" = { + autoconnect = ["qemu:///system"]; + uris = ["qemu:///system"]; + }; + }; + }; in lib.attrsets.updateManyAttrsByPath [ { @@ -21,6 +28,7 @@ bitwarden firefox gimp + virt-manager wezterm zotero ]); @@ -31,11 +39,15 @@ extraSpecialArgs = { inherit system stateVersion; }; }; + # virt-manager requires dconf to remember settings. + programs.dconf.enable = true; + users.users.jrpotter = { isNormalUser = true; extraGroups = [ "docker" "networkmanager" + "libvirtd" "wheel" ]; };