diff --git a/modules/user/packages/coding.nix b/modules/user/packages/coding.nix index 1a5c0e2..5e55236 100644 --- a/modules/user/packages/coding.nix +++ b/modules/user/packages/coding.nix @@ -1,4 +1,11 @@ -{ pkgs, ... }: { +{ pkgs, ... }: + +let + free-coding-models = import ./free-coding-models.nix { + inherit pkgs; + }; +in +{ home.packages = with pkgs; [ #jetbrains.idea-oss android-studio @@ -6,6 +13,7 @@ git tree opencode + free-coding-models postgresql dbgate ]; diff --git a/modules/user/packages/free-coding-models.nix b/modules/user/packages/free-coding-models.nix new file mode 100644 index 0000000..f75cffb --- /dev/null +++ b/modules/user/packages/free-coding-models.nix @@ -0,0 +1,58 @@ +{ pkgs, ... }: + +let + pnpm = pkgs.pnpm_10; +in +pkgs.stdenv.mkDerivation rec { + pname = "free-coding-models"; + version = "0.5.97"; + + src = pkgs.fetchFromGitHub { + owner = "vava-nessa"; + repo = "free-coding-models"; + rev = "v${version}"; + hash = "sha256-1jjEBKoNUslrJEDNuqEQ7dHHiecJ3urOdH7MRrdhD1E="; + }; + + nativeBuildInputs = [ + pkgs.nodejs + pkgs.makeWrapper + pkgs.pnpmConfigHook + pnpm + ]; + + pnpmDeps = pkgs.fetchPnpmDeps { + inherit pname version src pnpm; + + fetcherVersion = 4; + + hash = "sha256-TYOXu2XAdoLqbJPB8idemkWcxahs4+Z6UXAnh3+C47o="; + }; + + dontNpmBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib/node_modules/free-coding-models + cp -r . $out/lib/node_modules/free-coding-models + + mkdir -p $out/bin + ln -s $out/lib/node_modules/free-coding-models/bin/free-coding-models.js \ + $out/bin/free-coding-models + + runHook postInstall + ''; + + postFixup = '' + wrapProgram $out/bin/free-coding-models \ + --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.nodejs ]} + ''; + + meta = { + description = "Find, benchmark and install free coding LLM models"; + homepage = "https://github.com/vava-nessa/free-coding-models"; + license = pkgs.lib.licenses.mit; + mainProgram = "free-coding-models"; + }; +}