Cuda + ollama on homepc
This commit is contained in:
parent
54c1a40ca7
commit
247379dce8
6 changed files with 72 additions and 25 deletions
30
flake.lock
generated
30
flake.lock
generated
|
|
@ -147,11 +147,11 @@
|
|||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738603892,
|
||||
"narHash": "sha256-RcFJjRJguv0dfvs3tf8bjClGd5kue9KWc5gnUBoi+bA=",
|
||||
"lastModified": 1738852155,
|
||||
"narHash": "sha256-K6kTeSafJ7Jz0o98OX8kov9P54kT7D/V5dgY8iXdXeI=",
|
||||
"owner": "kylekrein",
|
||||
"repo": "emacs-config",
|
||||
"rev": "1f6d6bde186abc4b95c37dff6509fa284c1be200",
|
||||
"rev": "d7c87a715cac6557b80844a5b4288ab7bbcf17a3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -166,11 +166,11 @@
|
|||
"nixpkgs-stable": "nixpkgs-stable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738487447,
|
||||
"narHash": "sha256-ijAfzHCr489cenoBBcmBn3huyeoitLx1f/9t2LaOwmE=",
|
||||
"lastModified": 1738809425,
|
||||
"narHash": "sha256-bGRsRKHhHBrG8EcJgsRAkFqVzMm2zIS+yns7rdCzvu8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "emacs-overlay",
|
||||
"rev": "a7f332f6e0813c9d0f53fe6539be1e7a65fff2e4",
|
||||
"rev": "590d6ecac05c53ae8a87af317efa06f4a99ab116",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -1012,11 +1012,11 @@
|
|||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1738277201,
|
||||
"narHash": "sha256-6L+WXKCw5mqnUIExvqkD99pJQ41xgyCk6z/H9snClwk=",
|
||||
"lastModified": 1738702386,
|
||||
"narHash": "sha256-nJj8f78AYAxl/zqLiFGXn5Im1qjFKU8yBPKoWEeZN5M=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "666e1b3f09c267afd66addebe80fb05a5ef2b554",
|
||||
"rev": "030ba1976b7c0e1a67d9716b17308ccdab5b381e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -1028,11 +1028,11 @@
|
|||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1738410390,
|
||||
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
|
||||
"lastModified": 1738680400,
|
||||
"narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3a228057f5b619feb3186e986dbe76278d707b6e",
|
||||
"rev": "799ba5bffed04ced7067a91798353d360788b30d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -1044,11 +1044,11 @@
|
|||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1738410390,
|
||||
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
|
||||
"lastModified": 1738680400,
|
||||
"narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3a228057f5b619feb3186e986dbe76278d707b6e",
|
||||
"rev": "799ba5bffed04ced7067a91798353d360788b30d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@
|
|||
config = {
|
||||
allowBroken = true;
|
||||
allowUnfree = true;
|
||||
cudaSupport = true;
|
||||
};
|
||||
};
|
||||
modules = [
|
||||
|
|
@ -152,6 +153,7 @@
|
|||
allowBroken = true;
|
||||
allowUnfree = true;
|
||||
allowUnsupportedSystem = true;
|
||||
# rocmSupport = true;
|
||||
};
|
||||
};
|
||||
modules = [
|
||||
|
|
|
|||
|
|
@ -119,11 +119,11 @@
|
|||
};
|
||||
};
|
||||
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme = "qt5ct";
|
||||
style = "kvantum";
|
||||
};
|
||||
#qt = {
|
||||
# enable = true;
|
||||
# platformTheme = "qt5ct";
|
||||
# style = "kvantum";
|
||||
#};
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
|
|
|
|||
|
|
@ -24,6 +24,49 @@
|
|||
|
||||
#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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,11 +106,11 @@
|
|||
};
|
||||
services.hypridle.enable = true;
|
||||
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme = "qt5ct";
|
||||
style = "kvantum";
|
||||
};
|
||||
# qt = {
|
||||
#enable = true;
|
||||
#platformTheme = "qt5ct";
|
||||
#style = "kvantum";
|
||||
# };
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ in {
|
|||
};
|
||||
systemd.tmpfiles.rules = [
|
||||
"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/nixos-config 0700 ${username} users -"
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue