nixos/desktop/virtualization.nix
Julian Sutter 82a98a1e6f refactor: Apply syntactic updates for NixOS best practices
This commit applies comprehensive syntactic improvements across the
repository to conform to NixOS formatting and coding standards.

## Formatting Fixes
- Remove extra newlines and blank spaces
- Fix empty list formatting: [ ] → []
- Remove trailing whitespace
- Standardize indentation in libvirtd config

## Best Practices
- Remove deprecated networking.useDHCP setting
- Remove unused extraHosts configuration
- Add lib.mkDefault to videoDrivers for better override support
- Add lib.mkDefault to podman for consistency

## Modern Conventions
- Update nix.settings.download-buffer-size to string format with units ("512M")
- Update system.stateVersion from 25.05 to 25.11 to match channel
- Update home.stateVersion from 25.05 to 25.11 to match channel

## Code Quality
- Remove commented-out code in aurora.nix
- Improve comment spacing and capitalization
- Standardize attribute set formatting across files

## Files Modified
- flake.nix
- desktop/virtualization.nix
- systems/aurora.nix
- systems/common.nix
- systems/labrizor.nix
- systems/skip01.nix
- users/jsutter.nix

Tested: Successfully rebuilt and switched framework system
2026-02-03 22:40:05 -08:00

65 lines
1.7 KiB
Nix

{ config, pkgs, home-manager, ... }:
{
virtualisation = {
libvirtd = {
enable = true;
qemu.swtpm.enable = true;
};
spiceUSBRedirection.enable = true;
docker = {
rootless = {
enable = true;
setSocketVariable = true;
};
# Use journald for logging for better integration with system logs
extraOptions = "--log-driver=journald";
# Optional: configure daemon settings as needed (e.g., registry mirrors, storage drivers)
# settings = {
# "registry-mirrors" = [ "https://mirror.gcr.io" ];
# };
};
};
services.spice-vdagentd.enable = true;
environment.systemPackages = with pkgs; [
virt-manager # optional GUI for libvirt, not required for Quickemu
virt-viewer # gives remote-viewer
spice-gtk
spice-protocol
virtio-win
win-spice
quickemu
docker
];
environment.sessionVariables.LIBVIRT_DEFAULT_URI = [ "qemu:///system" ];
boot.kernelModules = [ "bridge" ];
# Enable network-online.target
systemd.services.network-online = {
enable = true;
wantedBy = [ "network.target" ];
};
# Tie services to network-online.target
systemd.services.libvirtd = {
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
};
# Optional: Add a debug hook
systemd.services.network-debug = {
description = "Log network status";
serviceConfig = {
# Use bash and provide full paths for commands
ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.iproute2}/bin/ip a && journalctl -u network.target'";
Type = "oneshot";
};
wantedBy = [ "network-online.target" ];
};
virtualisation.libvirtd.allowedBridges = [ "br0" ];
}