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
Generated
+48
View File
@@ -0,0 +1,48 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1781810163,
"narHash": "sha256-dk8lIk0UnO8GD3e7e3HM1vSYXpbEDmhy67w7KztfdCg=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c8f0b8ed441c95bfeaf33555e7631044bb09f384",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1781577229,
"narHash": "sha256-lrp67w8AulE9Ks53n27I45ADSzbOCn4H+CNW1Ck8B+8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "567a49d1913ce81ac6e9582e3553dd90a955875f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+29 -5
View File
@@ -1,15 +1,39 @@
{ {
description = "A very basic flake"; description = "NixOS Dotfiles";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs }: { outputs =
{
self,
nixpkgs,
home-manager,
}@inputs:
{
nixosConfigurations = {
laptop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/laptop/configuration.nix
home-manager.nixosModules.default
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello; {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
packages.x86_64-linux.default = self.packages.x86_64-linux.hello; home-manager.users.river = import ./hosts/laptop/home.nix;
}
}; ];
};
}
};
} }
View File
+40
View File
@@ -0,0 +1,40 @@
{ config, pkgs, ... }:
{
programs.bash = {
enable = true;
shellAliases = {
cd = "z";
cat = "bat";
ocat = "\cd"; # The \ is used to prevent alias expansion in the alias definition
docker = "podman";
ls = "eza --icons";
ols = "\ls";
kubectx = "kubectl config use-context";
# Nix Stuff
nrs = "sudo nixos-rebuild switch --flake ~/Dotfiles#laptop";
update = "nix flake update --flake ~/Dotfiles#laptop";
upgrade = "update && nrs";
# Single Letter Aliases
v = "nvim";
};
initExtra = ''
eval "$(zoxide init bash)"
source ${pkgs.carapace}/share/bash/carapace.bash
export EDITOR=nvim
'';
# Just to make sure pkgs are installed
home.packages = with pkgs; [
bat
eza
zoxide
carapace
neovim
kubectl
];
}
}
+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
View File
+32
View File
@@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
...
}:
{
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
virtualisation.libvirtd.qemu = {
ovmf.enable = true;
swtpm.enable = true;
};
boot.kernelModules = [
"kvm-intel"
"kvm-amd"
];
users.users.river.extraGroups = [
"libvirtd"
"kvm"
];
environment.systemPackages = with pkgs; [
virt-manager
qemu
];
};