dotfiles/machines/vm-audio.nix

85 lines
1.6 KiB
Nix
Raw Normal View History

2025-04-16 13:35:45 +00:00
{
lib,
pkgs,
config,
...
}:
{
imports = [
# Import environment
./vm-base.nix
];
config = {
# Machine hostname
networking.hostName = "vm-audio";
# Enabled modules
modules = {
};
# Hardware configuration
hardware.enableRedistributableFirmware = true;
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
hardware.cpu.intel.updateMicrocode = true;
# Filesystems
fileSystems."/" = {
device = "/dev/disk/by-partlabel/root";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-partlabel/EFI";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
# Swapfile
swapDevices = [
{
device = "/var/lib/swapfile";
size = 6 * 1024;
}
];
2025-04-16 13:23:22 +00:00
# User for audio mixing
users.users.mixer = {
2025-04-16 13:43:58 +00:00
isNormalUser = true;
2025-04-16 13:23:22 +00:00
group = "mixer";
2025-04-16 13:58:48 +00:00
extraGroups = [ "systemd-journal" ];
2025-04-16 13:23:22 +00:00
};
2025-04-16 13:24:55 +00:00
users.groups.mixer = { };
2025-04-16 13:23:22 +00:00
# wprsd service
2025-04-16 13:43:58 +00:00
systemd.user.services.wprsd = {
2025-04-16 13:35:45 +00:00
description = "wprsd Service";
2025-04-16 13:23:22 +00:00
wantedBy = [ "default.target" ];
after = [ "network.target" ];
2025-04-16 13:43:58 +00:00
unitConfig = {
ConditionUser = "mixer";
};
2025-04-16 13:23:22 +00:00
serviceConfig = {
ExecStart = "${pkgs.wprs}/bin/wprsd";
2025-04-16 13:43:58 +00:00
Environment = "\"RUST_BACKTRACE=1\"";
2025-04-16 13:23:22 +00:00
Restart = "always";
RestartSec = 5;
};
};
};
}