module based approach, trying to work on qemu virt?

This commit is contained in:
2026-06-18 18:51:58 -05:00
parent 0667034c69
commit 57f459b8f8
9 changed files with 293 additions and 5 deletions
+111
View File
@@ -0,0 +1,111 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./hardware-configuration.nix
];
boot = {
loader = {
grub = {
enable = true;
device = "nodev";
efiSupport = true;
};
efi.canTouchEfiVariables = true;
};
};
networking.hostName = "laptop";
networking.networkmanager.enable = true;
time.timeZone = "America/Chicago";
services.printing.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
};
services.libinput.enable = true;
users.users.river = {
isNormalUser = true;
extraGroups = [
"wheel"
"libvirtd"
"kvm"
];
};
programs.firefox.enable = true;
programs.virt-manager.enable = true;
programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
environment.systemPackages = with pkgs; [
neovim
git
curl
btop
ghostty
starship
tmux
zoxide
fd
ripgrep
fzf
cmatrix
];
virtualization = {
libvirtd.enable = true;
spiceUSBRedirection.enable = true;
podman = {
enable = true;
dockerCompat = true; # lets you use `docker` commands → podman
defaultNetwork.settings.dns_enabled = true;
};
};
services.openssh.enable = true;
services.code-server = {
enable = true;
port = 8080;
host = "127.0.0.1";
user = "river";
hashedPassword = "$argon2i$v=19$m=4096,t=3,p=1$Y2FLOGxUbVZrQWhUVUxlQnR4Z3MrNUd5ZVpFPQ$QZllzyC8qFmODAS9xW8OqPI5FoVoenYNKvbNMn+KTro";
};
services.caddy = {
enable = true;
package = pkgs.caddy;
extraConfig = ''
:80
reverse_proxy localhost:8080
'';
};
networking.firewall = {
enable = true;
allowedTCPPorts = [
22
80
];
};
system.stateVersion = "26.05";
}
+33
View File
@@ -0,0 +1,33 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "uas" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/38bebcad-2550-4dd2-88af-4fbce1c0c905";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/59D6-6348";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/398298a3-c3df-45fb-9667-fbee66cdb40f"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
View File