gitea repo
This commit is contained in:
commit
f610209aff
66 changed files with 2439 additions and 0 deletions
4
hosts/vm_ollama/boot.nix
Normal file
4
hosts/vm_ollama/boot.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
}
|
28
hosts/vm_ollama/default.nix
Normal file
28
hosts/vm_ollama/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ pkgs, inputs, config, lib, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./boot.nix
|
||||
./hardware.nix
|
||||
./ollama.nix
|
||||
../../modules/common/default.nix
|
||||
../../modules/common/system-d_boot.nix
|
||||
../../modules/networking/ssh.nix
|
||||
../../modules/networking/hosts.nix
|
||||
../../modules/user
|
||||
../../modules/apps/00_tui_base.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
];
|
||||
|
||||
config = {
|
||||
user = "ollama";
|
||||
host = "vm_ollama";
|
||||
sops_file = "home.yaml";
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
security.pki.certificates = [ (builtins.readFile ../../dotfiles/certs/mfCA.crt) ];
|
||||
};
|
||||
}
|
||||
|
38
hosts/vm_ollama/hardware.nix
Normal file
38
hosts/vm_ollama/hardware.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
# 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 = [ "ahci" "virtio_pci" "xhci_pci" "virtio_scsi" "sr_mod" "virtio_blk" "amdgpu" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
services.qemuGuest.enable = true;
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/a1324d7d-aa2d-4fc8-9ec7-797ef1537c30";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/69C2-3355";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
|
||||
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.enp2s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
39
hosts/vm_ollama/ollama.nix
Normal file
39
hosts/vm_ollama/ollama.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, pkgs, ... }: {
|
||||
config = {
|
||||
|
||||
fileSystems."/mnt/ollama_models" =
|
||||
{ device = "ollama_models";
|
||||
fsType = "virtiofs";
|
||||
options = [ "nosuid" "nodev" "nofail" ];
|
||||
};
|
||||
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
rocmPackages_6.clr.icd
|
||||
rocmPackages_6.rocminfo
|
||||
rocmPackages_6.rocm-smi
|
||||
rocmPackages_6.rocm-device-libs
|
||||
radeontop
|
||||
clinfo
|
||||
amdvlk
|
||||
];
|
||||
|
||||
users.users.ollama.extraGroups = [ "render" "video" ];
|
||||
|
||||
services.ollama = {
|
||||
enable = true;
|
||||
acceleration = "rocm";
|
||||
host = "0.0.0.0";
|
||||
port = 11357;
|
||||
openFirewall = true;
|
||||
models = "/mnt/ollama_models/";
|
||||
rocmOverrideGfx = "10.3.0";
|
||||
environmentVariables = {
|
||||
OLLAMA_KEEP_ALIVE="15m";
|
||||
};
|
||||
};
|
||||
|
||||
environment.variables.OLLAMA_HOST = "0.0.0.0:11357";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue