diff --git a/flake.lock b/flake.lock index c91829bf..db0a33da 100644 --- a/flake.lock +++ b/flake.lock @@ -912,6 +912,24 @@ } }, "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { "inputs": { "nixpkgs-lib": [ "lanzaboote", @@ -932,7 +950,25 @@ "type": "github" } }, - "flake-parts_5": { + "flake-parts_6": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_3" + }, + "locked": { + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_7": { "inputs": { "nixpkgs-lib": [ "nixvim", @@ -953,7 +989,7 @@ "type": "github" } }, - "flake-parts_6": { + "flake-parts_8": { "inputs": { "nixpkgs-lib": [ "nur", @@ -974,7 +1010,7 @@ "type": "github" } }, - "flake-parts_7": { + "flake-parts_9": { "inputs": { "nixpkgs-lib": [ "stylix", @@ -1959,13 +1995,18 @@ } }, "ik_llama": { - "flake": false, + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": [ + "nixpkgs" + ] + }, "locked": { - "lastModified": 1761491330, - "narHash": "sha256-z3Xojb/4Mbc0cZhePBpIKGCIP1Hzey8FBnFkEPR4PVs=", + "lastModified": 1761814188, + "narHash": "sha256-DFQbWKotdhsWWPCxdaYSKb5/SoZwnEwDfk0Av3J46cI=", "owner": "ikawrakow", "repo": "ik_llama.cpp", - "rev": "f76e98536f9377b29e2058cf83e0aa0450b631c8", + "rev": "14760aaf46383a7c4d2302277412ca8c423613c5", "type": "github" }, "original": { @@ -2047,7 +2088,7 @@ "inputs": { "crane": "crane_4", "flake-compat": "flake-compat_5", - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_5", "nixpkgs": [ "nixpkgs" ], @@ -2090,7 +2131,12 @@ } }, "llama-cpp": { - "flake": false, + "inputs": { + "flake-parts": "flake-parts_6", + "nixpkgs": [ + "nixpkgs" + ] + }, "locked": { "lastModified": 1755280252, "narHash": "sha256-0mONJiAOxdLNeBjDlMKMjk0NtrF8oEtVdw+QlDWrRq8=", @@ -2511,6 +2557,30 @@ "type": "github" } }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1722555339, + "narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" + } + }, + "nixpkgs-lib_3": { + "locked": { + "lastModified": 1730504152, + "narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + } + }, "nixpkgs-master": { "locked": { "lastModified": 1761567118, @@ -2715,7 +2785,7 @@ }, "nixvim": { "inputs": { - "flake-parts": "flake-parts_5", + "flake-parts": "flake-parts_7", "nixpkgs": [ "nixpkgs" ], @@ -2804,7 +2874,7 @@ }, "nur": { "inputs": { - "flake-parts": "flake-parts_6", + "flake-parts": "flake-parts_8", "nixpkgs": "nixpkgs_12" }, "locked": { @@ -3324,7 +3394,7 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts_7", + "flake-parts": "flake-parts_9", "gnome-shell": "gnome-shell", "nixpkgs": [ "nixpkgs" diff --git a/flake.nix b/flake.nix index ed4928b9..5e4d4be7 100644 --- a/flake.nix +++ b/flake.nix @@ -199,12 +199,12 @@ ik_llama = { url = "github:ikawrakow/ik_llama.cpp?submodules=1"; # submodules = true; - flake = false; + inputs.nixpkgs.follows = "nixpkgs"; }; llama-cpp = { # url = "https://github.com/ggml-org/llama.cpp"; url = "github:ggml-org/llama.cpp/b6178?submodules=1"; - flake = false; + inputs.nixpkgs.follows = "nixpkgs"; }; immich = { url = "github:immich-app/immich/v1.142.0"; diff --git a/home/apps/lmstudio.nix b/home/apps/lmstudio.nix index b785e30a..7cbea193 100644 --- a/home/apps/lmstudio.nix +++ b/home/apps/lmstudio.nix @@ -6,6 +6,9 @@ }: lib.mkIf (device.is "ryu") { home.packages = with pkgs; [ - lmstudio + (lmstudio.overrideAttrs + (old: { + extraPkgs = old.extraPkgs or [] ++ [pkgs.cudaPackages.cudatoolkit]; + })) ]; } diff --git a/home/apps/zed.nix b/home/apps/zed.nix index 473fed3e..5f3fb170 100644 --- a/home/apps/zed.nix +++ b/home/apps/zed.nix @@ -102,21 +102,8 @@ metrics = false; }; buffer_font_size = lib.mkDefault 15; - # language_models = { - # ollama = { - # api_url = "https://ollama.ryu.darksailor.dev"; - # available_models = [ - # { - # name = "qwen3:30b-a3b"; - # display_name = "Qwen3 MoE (30b-a3b)"; - # max_tokens = 32768; - # supports_tools = true; - # supports_thinking = false; - # supports_images = false; - # } - # ]; - # }; - # }; + language_models = { + }; terminal = { shell = { program = "${pkgs.fish}/bin/fish"; diff --git a/justfile b/justfile index c68c268b..7778a4b7 100644 --- a/justfile +++ b/justfile @@ -6,7 +6,7 @@ install: [linux] install: - sudo nixos-rebuild switch --flake . + sudo nixos-rebuild switch --flake . --builders '' [macos] build: diff --git a/nixos/mirai/services/games/default.nix b/nixos/mirai/services/games/default.nix index ed85cd3f..ddca14d6 100644 --- a/nixos/mirai/services/games/default.nix +++ b/nixos/mirai/services/games/default.nix @@ -2,5 +2,6 @@ imports = [ ./minecraft.nix ./satisfactory.nix + ./terraria.nix ]; } diff --git a/nixos/mirai/services/games/terraria.nix b/nixos/mirai/services/games/terraria.nix new file mode 100644 index 00000000..68698f58 --- /dev/null +++ b/nixos/mirai/services/games/terraria.nix @@ -0,0 +1,7 @@ +{...}: { + services.terraria = { + enable = true; + # port = 7777; + autoCreatedWorldSize = "large"; + }; +} diff --git a/nixos/ryu/programs/default.nix b/nixos/ryu/programs/default.nix index 99501b1f..bd0bc370 100644 --- a/nixos/ryu/programs/default.nix +++ b/nixos/ryu/programs/default.nix @@ -8,5 +8,6 @@ ./obs-studio.nix ./gnome-disks.nix ./nix-ld.nix + ./gamemode.nix ]; } diff --git a/nixos/ryu/programs/gamemode.nix b/nixos/ryu/programs/gamemode.nix new file mode 100644 index 00000000..ebae3048 --- /dev/null +++ b/nixos/ryu/programs/gamemode.nix @@ -0,0 +1,5 @@ +{...}: { + programs.gamemode = { + enable = true; + }; +} diff --git a/nixos/ryu/programs/steam.nix b/nixos/ryu/programs/steam.nix index 83c3c77d..7b39ab00 100644 --- a/nixos/ryu/programs/steam.nix +++ b/nixos/ryu/programs/steam.nix @@ -4,10 +4,17 @@ gamescopeSession.enable = true; remotePlay.openFirewall = true; dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers extraCompatPackages = [ pkgs.proton-ge-bin + pkgs.gamescope + pkgs.mangohud ]; }; + programs.gamescope = { + enable = true; + capSysNice = true; + }; environment.systemPackages = [ pkgs.protonup-qt ]; diff --git a/nixos/ryu/ryu.nix b/nixos/ryu/ryu.nix index 0fe09fd7..07b3a1b3 100644 --- a/nixos/ryu/ryu.nix +++ b/nixos/ryu/ryu.nix @@ -87,6 +87,7 @@ "nvidia_modeset" "nvidia_drm" "dm-snapshot" + "dm-mirror" ]; boot.kernelParams = [ "intel_iommu=on" diff --git a/nixos/ryu/services/default.nix b/nixos/ryu/services/default.nix index 45e13009..cc58aed3 100644 --- a/nixos/ryu/services/default.nix +++ b/nixos/ryu/services/default.nix @@ -4,8 +4,8 @@ # ./sunshine.nix # ./zerotier.nix # ./dnscrypt.nix - ./ollama.nix - # ./llama.nix + # ./ollama.nix + ./llama.nix ./tailscale.nix ./samba.nix ./mullvad.nix diff --git a/nixos/ryu/services/llama.nix b/nixos/ryu/services/llama.nix index 9bce0112..8e35d221 100644 --- a/nixos/ryu/services/llama.nix +++ b/nixos/ryu/services/llama.nix @@ -1,20 +1,28 @@ { pkgs, config, + inputs, ... }: { services = { llama-cpp = { enable = true; - port = 11435; - model = pkgs.fetchurl { - url = "https://huggingface.co/lmstudio-community/gpt-oss-20b-GGUF/resolve/main/gpt-oss-20b-MXFP4.gguf"; - sha256 = "65d06d31a3977d553cb3af137b5c26b5f1e9297a6aaa29ae7caa98788cde53ab"; - }; - # package = pkgs.ik_llama; - }; - ollama = { - enable = true; + port = 11345; + model = "/nix/store/ch6z9di3l0k54ad29pzv8k3zv47q30d1-Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf"; + # model = pkgs.fetchurl { + # # url = "https://huggingface.co/lmstudio-community/gpt-oss-20b-GGUF/resolve/main/gpt-oss-20b-MXFP4.gguf"; + # # sha256 = "65d06d31a3977d553cb3af137b5c26b5f1e9297a6aaa29ae7caa98788cde53ab"; + # url = "https://huggingface.co/lmstudio-community/Qwen3-Coder-30B-A3B-Instruct-GGUF/resolve/main/Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf"; + # sha256 = "79ad15a5ee3caddc3f4ff0db33a14454a5a3eb503d7fa1c1e35feafc579de486"; + # }; + extraFlags = [ + "-c" + "98304" + "--jinja" + # "--chat-template-file" + # "/nix/store/4zk1p50hrzghp3jzzysz96pa64i2kmjl-promp.hbs" + ]; + # package = inputs.llama-cpp.packages.${pkgs.system}.cuda; }; caddy = { virtualHosts."llama.ryu.darksailor.dev".extraConfig = '' @@ -23,7 +31,7 @@ ''; }; }; - # environment.systemPackages = with pkgs; [ - # vllm - # ]; + environment.systemPackages = with pkgs; [ + llama-cpp + ]; } diff --git a/nixos/ryu/services/ollama.nix b/nixos/ryu/services/ollama.nix index 64fcc5d9..e4aa568b 100644 --- a/nixos/ryu/services/ollama.nix +++ b/nixos/ryu/services/ollama.nix @@ -6,7 +6,7 @@ }: { services = { ollama = { - enable = true; + enable = false; host = "0.0.0.0"; # loadModels = ["deepseek-r1:7b" "deepseek-r1:14b" "RobinBially/nomic-embed-text-8k" "qwen3:8b" "qwen3:14b"]; # loadModels = ["deepseek-r1:7b" "deepseek-r1:14b" "RobinBially/nomic-embed-text-8k" "qwen3:8b" "qwen3:14b"]; diff --git a/overlays.nix b/overlays.nix index dd33b476..272906fa 100644 --- a/overlays.nix +++ b/overlays.nix @@ -121,10 +121,10 @@ }; }; ddcbacklight = inputs.ddcbacklight.packages.${prev.system}.ddcbacklight; - ik_llama = prev.llama-cpp.overrideAttrs (oldAttrs: { - src = inputs.ik_llama; - version = "5995"; - }); + # ik_llama = prev.llama-cpp.overrideAttrs (oldAttrs: { + # src = inputs.ik_llama; + # version = "5995"; + # }); # llama-cpp = prev.llama-cpp.overrideAttrs (oldAttrs: { # src = inputs.llama-cpp; # version = "6178"; @@ -304,14 +304,15 @@ in [ inputs.rust-overlay.overlays.default inputs.nix-minecraft.overlay inputs.lfca.overlays.default - # inputs.ik_llama.overlays.default jellyfin libfprint misc-applications nix-index-db shell-scipts tmuxPlugins + zellij + # inputs.llama-cpp.overlays.default + # inputs.ik_llama.overlays.default # tree-sitter-grammars # vimPlugins - zellij ]