Configuration for my NixOS based systems and Home Manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add lmstudio overlay

+55
+5
flake.nix
··· 120 120 modules = [ 121 121 ./host-specific/shizuri/configuration.nix 122 122 ]; 123 + overlays = [ 124 + (final: prev: { 125 + lmstudio = final.pkgs.callPackage ./overlays/lmstudio.nix { }; 126 + }) 127 + ]; 123 128 }; 124 129 nixosConfigurations.misaki = basicSystem { 125 130 useUnstable = true;
+1
host-specific/aleister-noah.nix
··· 70 70 #unstable.tk 71 71 #unstable.tclPackages.tclx 72 72 nodejs 73 + rclone 73 74 74 75 # Dev tools 75 76 git
+49
overlays/lmstudio.nix
··· 1 + { 2 + lib, 3 + appimageTools, 4 + fetchurl, 5 + lmstudioVersion ? "0.4.2-1", 6 + }: 7 + let 8 + pname = "lmstudio"; 9 + version = lmstudioVersion; 10 + 11 + src = fetchurl { 12 + url = "https://installers.lmstudio.ai/linux/x64/${version}/LM-Studio-${version}-x64.AppImage"; 13 + hash = "sha256-K36Q8TvSDFdYPtAbz2qV4a1+rUvcB8+w3873IveoDoY="; 14 + }; 15 + 16 + appimageContents = appimageTools.extractType2 { inherit pname version src; }; 17 + in 18 + appimageTools.wrapType2 { 19 + inherit pname version src; 20 + 21 + extraInstallCommands = '' 22 + # Install desktop file 23 + install -Dm644 ${appimageContents}/lm-studio.desktop $out/share/applications/lm-studio.desktop 24 + substituteInPlace $out/share/applications/lm-studio.desktop \ 25 + --replace-fail "Exec=AppRun" "Exec=${pname}" 26 + 27 + # Install icons 28 + for size in 16 32 48 64 128 256 512 1024; do 29 + if [ -f "${appimageContents}/usr/share/icons/hicolor/''${size}x''${size}/apps/lm-studio.png" ]; then 30 + install -Dm644 "${appimageContents}/usr/share/icons/hicolor/''${size}x''${size}/apps/lm-studio.png" \ 31 + "$out/share/icons/hicolor/''${size}x''${size}/apps/lm-studio.png" 32 + fi 33 + done 34 + 35 + # Fallback: copy icon from root if exists 36 + if [ -f "${appimageContents}/lm-studio.png" ]; then 37 + install -Dm644 "${appimageContents}/lm-studio.png" "$out/share/icons/hicolor/256x256/apps/lm-studio.png" 38 + fi 39 + ''; 40 + 41 + meta = { 42 + description = "Discover, download, and run local LLMs"; 43 + homepage = "https://lmstudio.ai"; 44 + license = lib.licenses.unfree; 45 + platforms = [ "x86_64-linux" ]; 46 + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 47 + mainProgram = "lmstudio"; 48 + }; 49 + }