diff --git a/configuration.nix b/configuration.nix index 7923c9b..be3ee62 100644 --- a/configuration.nix +++ b/configuration.nix @@ -17,6 +17,7 @@ ./services/immich.nix ./services/gitea.nix ./services/minecraft.nix + ./services/llm.nix ]; systemd.targets = { @@ -26,8 +27,6 @@ hybrid-sleep.enable = false; }; - powerManagement.powertop.enable = true; - nix = { #garbage collection and cleanup stuff gc = { @@ -64,11 +63,11 @@ compressor = "zstd"; compressorArgs = [ "-19" ]; }; + kernelModules = [ # kernel module for case fan control "nct6775" ]; - }; environment.etc = { @@ -230,6 +229,7 @@ "minecraft" "gitea" "jellyfin" + "ollama" ]; hashedPasswordFile = "/etc/nixos/secrets/hashedPass"; diff --git a/flake.lock b/flake.lock index 96c6bab..5c3b03d 100644 --- a/flake.lock +++ b/flake.lock @@ -58,11 +58,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1728056216, - "narHash": "sha256-IrO06gFUDTrTlIP3Sz+mRB6WUoO2YsgMtOD3zi0VEt0=", + "lastModified": 1728269138, + "narHash": "sha256-oKxDImsOvgUZMY4NwXVyUc/c1HiU2qInX+b5BU0yXls=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "b7ca02c7565fbf6d27ff20dd6dbd49c5b82eef28", + "rev": "ecfcd787f373f43307d764762e139a7cdeb9c22b", "type": "github" }, "original": { @@ -74,16 +74,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728018373, - "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", + "lastModified": 1728348559, + "narHash": "sha256-jVgMjAEhwvnuI1WZWoZfM8Luh3zsjn4ZsfOHKKF7kKI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bc947f541ae55e999ffdb4013441347d83b00feb", + "rev": "6235ae1ef7b09fe720a7f32bd38f74ccb859305a", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "master", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 6f07bbf..9c57d1a 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,8 @@ description = "Flake for server muffin"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - # nixpkgs.url = "github:NixOS/nixpkgs/master"; + # nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; @@ -39,6 +39,7 @@ torrent = 6011; minecraft = 25565; gitea = 3281; + ollama = 11434; }; https = { @@ -76,6 +77,10 @@ data_dir = service_configs.services_dir + "/jellyfin"; cache_dir = service_configs.services_dir + "/jellyfin_cache"; }; + + ollama = { + data_dir = service_configs.services_dir + "/ollama"; + }; }; in { diff --git a/secrets/Jellyfin.Plugin.ListenBrainz.xml b/secrets/Jellyfin.Plugin.ListenBrainz.xml index 806cdae..aa01cea 100644 Binary files a/secrets/Jellyfin.Plugin.ListenBrainz.xml and b/secrets/Jellyfin.Plugin.ListenBrainz.xml differ diff --git a/services/llm.nix b/services/llm.nix new file mode 100644 index 0000000..73323a2 --- /dev/null +++ b/services/llm.nix @@ -0,0 +1,19 @@ +{ + pkgs, + config, + service_configs, + ... +}: +{ + services.ollama = { + enable = true; + home = service_configs.ollama.data_dir + "/home"; + models = service_configs.ollama.data_dir + "/home/models"; + environmentVariables = { + OLLAMA_LLM_LIBRARY = "cpu_avx2"; + }; + host = "0.0.0.0"; + port = service_configs.ports.ollama; + user = "ollama"; + }; +} diff --git a/services/minecraft.nix b/services/minecraft.nix index 1ca53ed..02cea05 100644 --- a/services/minecraft.nix +++ b/services/minecraft.nix @@ -5,7 +5,7 @@ ... }: let - heap_size = "6144M"; + heap_size = "3000M"; in { nixpkgs.config.allowUnfreePredicate = diff --git a/services/quadlet.nix b/services/quadlet.nix index 5011543..e65ecd3 100644 --- a/services/quadlet.nix +++ b/services/quadlet.nix @@ -1,4 +1,4 @@ -{ service_configs, ... }: +{ service_configs, config, ... }: { virtualisation.quadlet = { containers = { @@ -31,11 +31,13 @@ containerConfig = { image = "lscr.io/linuxserver/qbittorrent:latest"; name = "qbittorrent"; + autoUpdate = "registry"; + environments = { WEBUI_PORT = service_configs.ports.torrent; DOCKER_MODS = "ghcr.io/gabe565/linuxserver-mod-vuetorrent"; - PUID = 1000; - PGID = 1000; + # PUID = 1000; + PGID = config.users.groups.${config.services.jellyfin.group}.gid; }; volumes = [