Add virtmanager
This commit is contained in:
parent
b5f4e15db8
commit
de61f5becd
3 changed files with 68 additions and 24 deletions
|
|
@ -36,7 +36,7 @@
|
||||||
./starship.nix
|
./starship.nix
|
||||||
./stylix.nix
|
./stylix.nix
|
||||||
./teams.nix
|
./teams.nix
|
||||||
./virtualbox.nix
|
./virtmanager.nix
|
||||||
./xkb.nix
|
./xkb.nix
|
||||||
./xone.nix
|
./xone.nix
|
||||||
./yazi
|
./yazi
|
||||||
|
|
|
||||||
67
modules/programs/virtmanager.nix
Normal file
67
modules/programs/virtmanager.nix
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
options,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
module =
|
||||||
|
if config.conf.cpu == "intel" then
|
||||||
|
"kvm-intel"
|
||||||
|
else if config.conf.cpu == "amd" then
|
||||||
|
"kvm-amd"
|
||||||
|
else
|
||||||
|
"";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
options.mods = {
|
||||||
|
virtmanager.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
type = lib.types.bool;
|
||||||
|
example = true;
|
||||||
|
description = ''
|
||||||
|
Enables virt-manager kvm.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config =
|
||||||
|
lib.optionalAttrs (options ? virtualisation.libvirtd) {
|
||||||
|
boot.kernelModules = [
|
||||||
|
module
|
||||||
|
];
|
||||||
|
programs.virt-manager.enable = true;
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
spice
|
||||||
|
spice-gtk
|
||||||
|
spice-protocol
|
||||||
|
virt-viewer
|
||||||
|
];
|
||||||
|
virtualisation = {
|
||||||
|
libvirtd = {
|
||||||
|
enable = true;
|
||||||
|
qemu = {
|
||||||
|
package = pkgs.qemu_kvm;
|
||||||
|
swtpm.enable = true;
|
||||||
|
ovmf.enable = true;
|
||||||
|
ovmf.packages = [ pkgs.OVMFFull.fd ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
spiceUSBRedirection.enable = true;
|
||||||
|
};
|
||||||
|
services.spice-vdagentd.enable = true;
|
||||||
|
|
||||||
|
users.users.${config.conf.username}.extraGroups = [ "libvirtd" ];
|
||||||
|
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs (options ? dconf.settings) {
|
||||||
|
dconf.settings = {
|
||||||
|
"org/virt-manager/virt-manager/connections" = {
|
||||||
|
autoconnect = [ "qemu:///system" ];
|
||||||
|
uris = [ "qemu:///system" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
options,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.mods = {
|
|
||||||
virtualbox.enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
type = lib.types.bool;
|
|
||||||
example = true;
|
|
||||||
description = ''
|
|
||||||
Enables virtualbox.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.optionalAttrs (options ? virtualisation.virtualbox.host) {
|
|
||||||
virtualisation.virtualbox.host.enable = lib.mkIf config.mods.virtualbox.enable true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue