Added AI VM to dotfiles config

This commit is contained in:
Random936 2025-01-29 15:08:56 -08:00
parent 9355d1f23c
commit 608cc71fe5
4 changed files with 109 additions and 9 deletions

47
config/ai.nix Normal file
View File

@ -0,0 +1,47 @@
{ config, pkgs, inputs, lib, ... }: {
imports = [
../hardware/ai.nix
./headless.nix
(import ./networking.nix {
hostname = "mindforge";
ip_address = "192.168.100.45";
open_ports = [ ];
inherit lib;
})
];
users.users.mindforge = import ./user.nix;
# Setup drivers for NVIDIA GPU
services.xserver = {
enable = false;
videoDrivers = [ "nvidia" ];
};
hardware = {
nvidia = {
open = false;
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
nvidiaSettings = true;
};
graphics = {
enable = true;
enable32Bit = true;
};
};
services.open-webui = {
enable = true;
host = "0.0.0.0";
openFirewall = true;
};
services.ollama = {
enable = true;
acceleration = "cuda";
};
}

18
flake.lock generated
View File

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1736066484,
"narHash": "sha256-uTstP36WaFrw+TEHb8nLF14hFPzQBOhmIxzioHCDaL8=",
"lastModified": 1738188574,
"narHash": "sha256-I1gh2Ho565SDmbonmzj7sWbEgTXYyERmMT5KwuuaSDo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "5ad12b6ea06b84e48f6b677957c74f32d47bdee0",
"rev": "6aa38ffdf77fb4250f5d832fd5a09eb99226fba7",
"type": "github"
},
"original": {
@ -28,11 +28,11 @@
]
},
"locked": {
"lastModified": 1736085891,
"narHash": "sha256-bTl9fcUo767VaSx4Q5kFhwiDpFQhBKna7lNbGsqCQiA=",
"lastModified": 1738033138,
"narHash": "sha256-qlIM8A3bdL9c6PexhpS+QyZLO9y/8a3V75HVyJgDE5Q=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "ba9b3173b0f642ada42b78fb9dfc37ca82266f6c",
"rev": "349a74c66c596ef97ee97b4d80a3ca61227b6120",
"type": "github"
},
"original": {
@ -43,11 +43,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1735834308,
"narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=",
"lastModified": 1738021509,
"narHash": "sha256-JNUiceGsr7cVBUQxLBF1ILCe99E0qLxsVuet6GsZUuw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6df24922a1400241dae323af55f30e4318a6ca65",
"rev": "9db269672dbdbb519e0bd3ea24f01506c135e46f",
"type": "github"
},
"original": {

View File

@ -51,6 +51,14 @@
];
};
nixosConfigurations."mindforge" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./config/ai.nix
];
};
# Home-Manager Configurations
@ -86,6 +94,14 @@
];
};
homeConfigurations.mindforge = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
extraSpecialArgs.user = "mindforge";
modules = [
./home/headless-nixos.nix
];
};
# Darwin Configuration

37
hardware/ai.nix Normal file
View File

@ -0,0 +1,37 @@
# 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 + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/b98eb7bb-f58c-4862-a234-1d72c9ff1187";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/3D03-9579";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp6s18.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}