Cuda + ollama on homepc

This commit is contained in:
Aleksandr Lebedev 2025-02-08 13:47:14 +01:00
parent 54c1a40ca7
commit 247379dce8
6 changed files with 72 additions and 25 deletions

30
flake.lock generated
View file

@ -147,11 +147,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1738603892, "lastModified": 1738852155,
"narHash": "sha256-RcFJjRJguv0dfvs3tf8bjClGd5kue9KWc5gnUBoi+bA=", "narHash": "sha256-K6kTeSafJ7Jz0o98OX8kov9P54kT7D/V5dgY8iXdXeI=",
"owner": "kylekrein", "owner": "kylekrein",
"repo": "emacs-config", "repo": "emacs-config",
"rev": "1f6d6bde186abc4b95c37dff6509fa284c1be200", "rev": "d7c87a715cac6557b80844a5b4288ab7bbcf17a3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -166,11 +166,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1738487447, "lastModified": 1738809425,
"narHash": "sha256-ijAfzHCr489cenoBBcmBn3huyeoitLx1f/9t2LaOwmE=", "narHash": "sha256-bGRsRKHhHBrG8EcJgsRAkFqVzMm2zIS+yns7rdCzvu8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "a7f332f6e0813c9d0f53fe6539be1e7a65fff2e4", "rev": "590d6ecac05c53ae8a87af317efa06f4a99ab116",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1012,11 +1012,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1738277201, "lastModified": 1738702386,
"narHash": "sha256-6L+WXKCw5mqnUIExvqkD99pJQ41xgyCk6z/H9snClwk=", "narHash": "sha256-nJj8f78AYAxl/zqLiFGXn5Im1qjFKU8yBPKoWEeZN5M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "666e1b3f09c267afd66addebe80fb05a5ef2b554", "rev": "030ba1976b7c0e1a67d9716b17308ccdab5b381e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1028,11 +1028,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1738410390, "lastModified": 1738680400,
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3a228057f5b619feb3186e986dbe76278d707b6e", "rev": "799ba5bffed04ced7067a91798353d360788b30d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1044,11 +1044,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1738410390, "lastModified": 1738680400,
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3a228057f5b619feb3186e986dbe76278d707b6e", "rev": "799ba5bffed04ced7067a91798353d360788b30d",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -121,6 +121,7 @@
config = { config = {
allowBroken = true; allowBroken = true;
allowUnfree = true; allowUnfree = true;
cudaSupport = true;
}; };
}; };
modules = [ modules = [
@ -152,6 +153,7 @@
allowBroken = true; allowBroken = true;
allowUnfree = true; allowUnfree = true;
allowUnsupportedSystem = true; allowUnsupportedSystem = true;
# rocmSupport = true;
}; };
}; };
modules = [ modules = [

View file

@ -119,11 +119,11 @@
}; };
}; };
qt = { #qt = {
enable = true; # enable = true;
platformTheme = "qt5ct"; # platformTheme = "qt5ct";
style = "kvantum"; # style = "kvantum";
}; #};
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget

View file

@ -24,6 +24,49 @@
#inputs.nix-gaming.packages.${pkgs.system}.star-citizen #inputs.nix-gaming.packages.${pkgs.system}.star-citizen
]; ];
#LLMs
services.ollama = {
enable = true;
loadModels = [ "deepseek-r1:32b" ];
acceleration = "cuda";
home = "/persist/ollama";
user = "ollama";
group = "ollama";
};
services.open-webui.enable = true;
services.open-webui.openFirewall = true;
services.open-webui.host = "0.0.0.0";
services.open-webui.stateDir = "/persist/open-webui";
systemd.services.open-webui.serviceConfig.User = "ollama";
systemd.services.open-webui.serviceConfig.Group = "ollama";
systemd.services.open-webui.serviceConfig.DynamicUser = lib.mkForce false;
#Chat host
networking.firewall.allowedTCPPorts = [ 80 443 ];
security.acme = {
acceptTerms = true;
defaults.email = "alex.lebedev2003@icloud.com";
};
services.nginx.enable = true;
services.nginx = {
# Use recommended settings
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
};
services.nginx.virtualHosts = let
SSL = {
enableACME = true;
forceSSL = true;
}; in {
"chat.kylekrein.com" = (SSL // {
locations."/" = {
proxyPass = "http://127.0.0.1:8080/";
proxyWebsockets = true;
};
});
};
systemd.network.wait-online.enable = lib.mkForce false; systemd.network.wait-online.enable = lib.mkForce false;
} }

View file

@ -106,11 +106,11 @@
}; };
services.hypridle.enable = true; services.hypridle.enable = true;
qt = { # qt = {
enable = true; #enable = true;
platformTheme = "qt5ct"; #platformTheme = "qt5ct";
style = "kvantum"; #style = "kvantum";
}; # };
} }

View file

@ -37,6 +37,8 @@ in {
}; };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d /persist/home/ 0777 root root -" # /persist/home created, owned by root "d /persist/home/ 0777 root root -" # /persist/home created, owned by root
"d /persist/ollama/ 0755 ollama ollama"
"d /persist/open-webui/ 0755 ollama ollama"
#"d /persist/home/${username} 0700 ${username} users -" # /persist/home/<user> created, owned by that user #"d /persist/home/${username} 0700 ${username} users -" # /persist/home/<user> created, owned by that user
#"d /persist/nixos-config 0700 ${username} users -" #"d /persist/nixos-config 0700 ${username} users -"
]; ];