add qemu & battery notifs
This commit is contained in:
parent
2a40dc791d
commit
eb0c28d2f0
@ -15,6 +15,7 @@ in
|
||||
ssh-agent = enabled;
|
||||
fusuma = enabled;
|
||||
swww = enabled;
|
||||
poweralertd = enabled;
|
||||
sops = {
|
||||
enable = true;
|
||||
defaultSopsFile = lib.snowfall.fs.get-file "secrets/default.yaml";
|
||||
|
17
modules/home/services/poweralertd/default.nix
Normal file
17
modules/home/services/poweralertd/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
15
modules/nixos/hardware/battery/upower/default.nix
Normal file
15
modules/nixos/hardware/battery/upower/default.nix
Normal 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;
|
||||
};
|
||||
}
|
58
modules/nixos/virtualisation/libvirtd/default.nix
Normal file
58
modules/nixos/virtualisation/libvirtd/default.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
}
|
@ -33,6 +33,9 @@ in
|
||||
|
||||
hardware = {
|
||||
opengl = enabled;
|
||||
battery = {
|
||||
upower = enabled;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
@ -43,6 +46,11 @@ in
|
||||
|
||||
virtualisation = {
|
||||
podman = enabled;
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
withVirtManager = true;
|
||||
enableAMDIOMMU = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user