diff options
| -rw-r--r-- | flake.lock | 17 | ||||
| -rw-r--r-- | flake.nix | 4 | ||||
| -rw-r--r-- | hosts/desktop/configuration.nix | 18 | ||||
| -rw-r--r-- | hosts/desktop/hardware-configuration.nix | 23 | ||||
| -rw-r--r-- | modules/common.nix | 2 |
5 files changed, 60 insertions, 4 deletions
@@ -78,6 +78,22 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1775423009, + "narHash": "sha256-vPKLpjhIVWdDrfiUM8atW6YkIggCEKdSAlJPzzhkQlw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "68d8aa3d661f0e6bd5862291b5bb263b2a6595c9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "inputs": { "flake-parts": "flake-parts", @@ -104,6 +120,7 @@ "home-manager": "home-manager", "nix-index-database": "nix-index-database", "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur" } } @@ -4,6 +4,8 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + home-manager = { url = "github:nix-community/home-manager/release-25.11"; @@ -19,7 +21,7 @@ }; }; - outputs = { self, nixpkgs, home-manager, nix-index-database, ... }@inputs: { + outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, nix-index-database, ... }@inputs: { nixosConfigurations = { hyper-v = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index cf4c360..96cc210 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -1,5 +1,12 @@ { config, lib, pkgs, inputs, ... }: +let + unstable = import inputs.nixpkgs-unstable { + system = "x86_64-linux"; + config.allowUnfree = true; + config.rocmSupport = true; + }; +in { imports = [ # Include the results of the hardware scan. @@ -25,5 +32,16 @@ "8.8.8.8" ]; + services.xserver.videoDrivers = [ "amdgpu" ]; + + services.ollama = { + enable = true; + package = unstable.ollama; + acceleration = "rocm"; + rocmOverrideGfx = "10.3.0"; + }; + + environment.variables.HSA_OVERRIDE_GFX_VERSION = "10.3.0"; + system.stateVersion = "25.11"; } diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix index 7ddea07..ba7f356 100644 --- a/hosts/desktop/hardware-configuration.nix +++ b/hosts/desktop/hardware-configuration.nix @@ -9,10 +9,19 @@ ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.kernelModules = [ "amdgpu" ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + rocmPackages.clr + rocmPackages.hipblas + rocmPackages.clr.icd + ]; + }; + fileSystems."/" = { device = "/dev/disk/by-uuid/e09483ea-5fb4-472d-99ba-3d4dc9560400"; fsType = "btrfs"; @@ -24,7 +33,17 @@ options = [ "fmask=0077" "dmask=0077" ]; }; - swapDevices = [ ]; + zramSwap = { + enable = true; + algorithm = "zstd"; + memoryPercent = 50; + priority = 100; + }; + + swapDevices = [ { + device = "/swap/swapfile"; + size = 32 * 1024; + } ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/modules/common.nix b/modules/common.nix index 102ab81..6ca9591 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -31,7 +31,7 @@ # User users.users.christian = { isNormalUser = true; - extraGroups = [ "wheel" "video" "docker" ]; + extraGroups = [ "wheel" "video" "render" "docker" ]; }; home-manager.users.christian = import ./home/christian.nix; |
