adding a true ollama config and updating to latest nixpkgs

This commit is contained in:
Chris Cochrun 2024-12-18 10:38:50 -06:00
parent 17401c9549
commit 41b97ef1d1
4 changed files with 68 additions and 56 deletions

View file

@ -50,16 +50,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720042825, "lastModified": 1734366194,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", "narHash": "sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", "rev": "80b0fdf483c5d1cb75aaad909bd390d48673857f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.05", "ref": "release-24.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -136,16 +136,16 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1732749044, "lastModified": 1734323986,
"narHash": "sha256-T38FQOg0BV5M8FN1712fovzNakSOENEYs+CSkg31C9Y=", "narHash": "sha256-m/lh6hYMIWDYHCAsn81CDAiXoT3gmxXI9J987W5tZrE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0c5b4ecbed5b155b705336aa96d878e55acd8685", "rev": "394571358ce82dff7411395829aa6a3aad45b907",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-24.05", "ref": "nixos-24.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -3,9 +3,9 @@
inputs = { inputs = {
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-24.05"; url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-bitcoin = { nix-bitcoin = {
@ -23,13 +23,17 @@
}; };
lib = nixpkgs.lib; lib = nixpkgs.lib;
unstable = nixpkgs; unstable = import nixpkgs-unstable {
inherit system;
config = { allowUnfree = true; };
};
in { in {
nixosConfigurations = { nixosConfigurations = {
shen = lib.nixosSystem { shen = lib.nixosSystem {
inherit system; inherit system;
pkgs = pkgsForSystem; pkgs = pkgsForSystem;
specialArgs = { inherit unstable; };
modules = [ modules = [
./system/shen/configuration.nix ./system/shen/configuration.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
@ -43,6 +47,7 @@
hoid = lib.nixosSystem { hoid = lib.nixosSystem {
inherit system; inherit system;
pkgs = pkgsForSystem; pkgs = pkgsForSystem;
specialArgs = { inherit unstable; };
modules = [ modules = [
./system/hoid/configuration.nix ./system/hoid/configuration.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager

View file

@ -1,8 +1,18 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, unstable, ... }:
with lib; with lib;
{ {
services.ollama = { services = {
ollama = {
enable = true; enable = true;
package = unstable.ollama;
# port = 11434;
acceleration = "cuda";
};
open-webui = {
enable = true;
port = 3082;
package = unstable.open-webui;
};
}; };
} }

View file

@ -12,6 +12,7 @@
../../modules/base.nix ../../modules/base.nix
../../modules/localai.nix ../../modules/localai.nix
../../modules/forgejo.nix ../../modules/forgejo.nix
../../modules/ollama.nix
# ../../pkgs/server.nix # ../../pkgs/server.nix
# ../../pkgs/ai.nix # ../../pkgs/ai.nix
]; ];
@ -44,7 +45,6 @@
# rocm-opencl-runtime # rocm-opencl-runtime
# amdvlk # amdvlk
]; ];
driSupport = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true; driSupport32Bit = lib.mkDefault true;
#extraPackages32 = with pkgs; [ #extraPackages32 = with pkgs; [
# driversi686linux.amdvlk # driversi686linux.amdvlk
@ -52,7 +52,8 @@
}; };
nvidia = { nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.stable; open = false;
# package = config.boot.kernelPackages.nvidiaPackages.stable;
modesetting.enable = true; modesetting.enable = true;
}; };
}; };
@ -64,41 +65,41 @@
virtualisation.docker.enableNvidia = true; virtualisation.docker.enableNvidia = true;
services.samba = { # services.samba = {
enable = true; # enable = true;
extraConfig = '' # extraConfig = ''
# security = share # # security = share
# passdb backend = tdbsam # # passdb backend = tdbsam
workgroup = WORKGROUP # workgroup = WORKGROUP
server string = smbnix # server string = smbnix
netbios name = smbnix # netbios name = smbnix
security = user # security = user
#use sendfile = yes # #use sendfile = yes
#max protocol = smb2 # #max protocol = smb2
# note: localhost is the ipv6 localhost ::1 # # note: localhost is the ipv6 localhost ::1
hosts allow = 172.16.1. 127.0.0.1 localhost # hosts allow = 172.16.1. 127.0.0.1 localhost
hosts deny = 0.0.0.0/0 # hosts deny = 0.0.0.0/0
guest account = chris # guest account = chris
map to guest = bad user # map to guest = bad user
''; # '';
shares = { # shares = {
public = { # public = {
path = "/storage/share"; # path = "/storage/share";
# "valid users" = "tfc"; # # "valid users" = "tfc";
public = "yes"; # public = "yes";
writeable = "yes"; # writeable = "yes";
browsable = "yes"; # browsable = "yes";
"read only" = "no"; # "read only" = "no";
"create mask" = "0644"; # "create mask" = "0644";
"directory mask" = "0755"; # "directory mask" = "0755";
"guest ok" = "yes"; # "guest ok" = "yes";
"force user" = "chris"; # "force user" = "chris";
"fruit:aapl" = "yes"; # "fruit:aapl" = "yes";
"fruit:time machine" = "yes"; # "fruit:time machine" = "yes";
"vfs objects" = "catia fruit streams_xattr"; # "vfs objects" = "catia fruit streams_xattr";
}; # };
}; # };
}; # };
# CADDY # CADDY
services.caddy = { services.caddy = {
@ -258,11 +259,7 @@
virtualHosts = { virtualHosts = {
"tfcconnection.org".extraConfig = '' "tfcconnection.org".extraConfig = ''
encode gzip encode gzip
handle_path /api* { reverse_proxy localhost:4242
reverse_proxy * 127.0.0.1:4242
}
root * /srv/tfcconnection
file_server
header { header {
Access-Control-Allow-Origin * Access-Control-Allow-Origin *
Access-Control-Allow-Origin https://api.tfcconnection.org Access-Control-Allow-Origin https://api.tfcconnection.org