add qemu & battery notifs

This commit is contained in:
Evan Reichard 2025-09-29 20:37:53 -04:00
parent 2a40dc791d
commit eb0c28d2f0
5 changed files with 99 additions and 0 deletions

View File

@ -15,6 +15,7 @@ in
ssh-agent = enabled; ssh-agent = enabled;
fusuma = enabled; fusuma = enabled;
swww = enabled; swww = enabled;
poweralertd = enabled;
sops = { sops = {
enable = true; enable = true;
defaultSopsFile = lib.snowfall.fs.get-file "secrets/default.yaml"; defaultSopsFile = lib.snowfall.fs.get-file "secrets/default.yaml";

View File

@ -0,0 +1,17 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.services.poweralertd;
in
{
options.${namespace}.services.poweralertd = {
enable = lib.mkEnableOption "poweralertd";
};
config = mkIf cfg.enable {
services.poweralertd = {
enable = true;
};
};
}

View File

@ -0,0 +1,15 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.hardware.battery.upower;
in
{
options.${namespace}.hardware.battery.upower = {
enable = lib.mkEnableOption "enable upower";
};
config = mkIf cfg.enable {
services.upower.enable = true;
};
}

View File

@ -0,0 +1,58 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.virtualisation.libvirtd;
in
{
options.${namespace}.virtualisation.libvirtd = {
enable = lib.mkEnableOption "enable libvirtd";
withVirtManager = mkBoolOpt false "add virt-manager";
enableIntelIOMMU = mkBoolOpt false "enable Intel IOMMU for better device passthrough";
enableAMDIOMMU = mkBoolOpt false "enable AMD IOMMU for better device passthrough";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
win-virtio
libvirt
qemu_kvm
] ++ lib.optionals cfg.withVirtManager [
virt-manager
virt-viewer
spice-gtk
];
reichard = {
user = {
extraGroups = [
"libvirtd"
];
};
};
virtualisation = {
libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
runAsRoot = false;
swtpm.enable = true;
ovmf = {
enable = true;
packages = [ pkgs.OVMFFull.fd ];
};
};
};
spiceUSBRedirection.enable = true;
};
boot.kernelParams = lib.optionals cfg.enableIntelIOMMU [
"intel_iommu=on"
] ++ lib.optionals cfg.enableAMDIOMMU [
"amd_iommu=on"
];
};
}

View File

@ -33,6 +33,9 @@ in
hardware = { hardware = {
opengl = enabled; opengl = enabled;
battery = {
upower = enabled;
};
}; };
services = { services = {
@ -43,6 +46,11 @@ in
virtualisation = { virtualisation = {
podman = enabled; podman = enabled;
libvirtd = {
enable = true;
withVirtManager = true;
enableAMDIOMMU = true;
};
}; };
programs = { programs = {