add kvm supports and add quickemu
This commit is contained in:
parent
2842a89b60
commit
d159fed672
6 changed files with 65 additions and 0 deletions
|
|
@ -30,6 +30,7 @@
|
|||
starship.enable = true;
|
||||
sops.enable = true;
|
||||
mpv.enable = true;
|
||||
kvm.enable = true;
|
||||
};
|
||||
|
||||
david = {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
./wluma.nix
|
||||
./waybar.nix
|
||||
./mpv.nix
|
||||
./kvm.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
|
|
|
|||
21
home/modules/kvm.nix
Normal file
21
home/modules/kvm.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.youthlic.programs.kvm;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
youthlic.programs.kvm = {
|
||||
enable = lib.mkEnableOption "kvm";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
dconf = {
|
||||
settings = {
|
||||
"org/virt-manager/virt-manager/connections" = {
|
||||
autoconnect = [ "qemu:///system" ];
|
||||
uris = [ "qemu:///system" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -31,6 +31,10 @@
|
|||
steam.enable = true;
|
||||
tailscale.enable = true;
|
||||
kanata.enable = true;
|
||||
kvm = {
|
||||
enable = true;
|
||||
unixName = "david";
|
||||
};
|
||||
};
|
||||
gui.enabled = "cosmic";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
./steam.nix
|
||||
./tailscale.nix
|
||||
./kanata.nix
|
||||
./kvm.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
|
|
|
|||
37
nixos/modules/kvm.nix
Normal file
37
nixos/modules/kvm.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.youthlic.programs.kvm;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
youthlic.programs.kvm = {
|
||||
enable = lib.mkEnableOption "kvm";
|
||||
unixName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "david";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
quickemu
|
||||
];
|
||||
programs.virt-manager = {
|
||||
enable = true;
|
||||
};
|
||||
users.groups.libvirtd.members = [ cfg.unixName ];
|
||||
virtualisation = {
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
};
|
||||
spiceUSBRedirection = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue