diff options
author | polwex <polwex@sortug.com> | 2025-07-27 03:34:16 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-07-27 03:34:16 +0700 |
commit | 2339fba37290774336fa517a417330e3ff788ba5 (patch) | |
tree | d4bf9d531538af6d0e4718e75ee38a350ade671f /derivations | |
parent | 7c959ef5c9c689c06aa5fe48110cdf6d780a438c (diff) |
spanch
Diffstat (limited to 'derivations')
-rw-r--r-- | derivations/codex/default.nix | 63 | ||||
-rw-r--r-- | derivations/codex/flake.nix | 19 | ||||
-rw-r--r-- | derivations/gemini/default.nix | 103 | ||||
-rw-r--r-- | derivations/gemini/flake.nix | 20 |
4 files changed, 205 insertions, 0 deletions
diff --git a/derivations/codex/default.nix b/derivations/codex/default.nix new file mode 100644 index 0000000..5a0f366 --- /dev/null +++ b/derivations/codex/default.nix @@ -0,0 +1,63 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + nix-update-script, + pkg-config, + openssl, + versionCheckHook, +}: +rustPlatform.buildRustPackage (finalAttrs: { + pname = "codex"; + version = "0.7.0"; + + src = fetchFromGitHub { + owner = "openai"; + repo = "codex"; + rev = "f14b5adabf5db34864c44c1ffc6c566b018fe0cc"; + # tag = "rust-v${finalAttrs.version}"; + hash = "sha256-rRe0JFEO5ixxrZYDL8kxXDOH0n7lqabkXNNaSlNnQDg="; + }; + + sourceRoot = "${finalAttrs.src.name}/codex-rs"; + + useFetchCargoVendor = true; + cargoHash = "sha256-QIZ3V4NUo1VxJN3cwdQf3S0zwePnwdKKfch0jlIJacU="; + + nativeBuildInputs = [ + pkg-config + ]; + buildInputs = [ + openssl + ]; + + checkFlags = [ + "--skip=keeps_previous_response_id_between_tasks" # Requires network access + "--skip=retries_on_early_close" # Requires network access + ]; + + doInstallCheck = true; + nativeInstallCheckInputs = [versionCheckHook]; + + passthru = { + updateScript = nix-update-script { + extraArgs = [ + "--version-regex" + "^rust-v(\\d+\\.\\d+\\.\\d+)$" + ]; + }; + }; + + meta = { + description = "Lightweight coding agent that runs in your terminal"; + homepage = "https://github.com/openai/codex"; + changelog = "https://raw.githubusercontent.com/openai/codex/refs/tags/rust-v${finalAttrs.version}/CHANGELOG.md"; + license = lib.licenses.asl20; + mainProgram = "codex"; + maintainers = with lib.maintainers; [ + malo + delafthi + ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/derivations/codex/flake.nix b/derivations/codex/flake.nix new file mode 100644 index 0000000..3a0a46f --- /dev/null +++ b/derivations/codex/flake.nix @@ -0,0 +1,19 @@ +{ + description = "Gemini CLI flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { + self, + nixpkgs, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.${system}.default = pkgs.callPackage ./default.nix { + inherit (pkgs) lib buildNpmPackage fetchFromGitHub fetchNpmDeps gitUpdater; + }; + }; +} diff --git a/derivations/gemini/default.nix b/derivations/gemini/default.nix new file mode 100644 index 0000000..ee53130 --- /dev/null +++ b/derivations/gemini/default.nix @@ -0,0 +1,103 @@ +# { +# lib, +# buildNpmPackage, +# fetchFromGitHub, +# fetchNpmDeps, +# writeShellApplication, +# cacert, +# curl, +# gnused, +# jq, +# nix-prefetch-github, +# prefetch-npm-deps, +# gitUpdater, +# }: +# buildNpmPackage (finalAttrs: { +# pname = "superapp"; +# version = "0.4.2"; +# src = fetchFromGitHub { +# owner = "sortugdev"; +# repo = "superapp"; +# tag = "v${finalAttrs.version}"; +# hash = "sha256-DAenod/w9BydYdYsOnuLj7kCQRcTnZ81tf4MhLUug6c="; +# }; +# npmDeps = fetchNpmDeps { +# inherit (finalAttrs) src; +# hash = "sha256-otogkSsKJ5j1BY00y4SRhL9pm7CK9nmzVisvGCDIMlU="; +# }; +# preConfigure = '' +# mkdir -p packages/generated +# echo "export const GIT_COMMIT_INFO = { commitHash: '${finalAttrs.src.rev}' };" > packages/generated/git-commit.ts +# ''; +# installPhase = '' +# runHook preInstall +# mkdir -p $out/{bin,share/superapp-cli} +# cp -r node_modules $out/share/superapp-cli/ +# rm -f $out/share/superapp-cli/node_modules/@sortug/superapp-cli +# rm -f $out/share/superapp-cli/node_modules/@sortug/superapp-cli-core +# cp -r packages/cli $out/share/superapp-cli/node_modules/@sortug/superapp-cli +# cp -r packages/core $out/share/superapp-cli/node_modules/@sortug/superapp-cli-core +# ln -s $out/share/superapp-cli/node_modules/@sortug/superapp-cli/dist/index.js $out/bin/superapp +# runHook postInstall +# ''; +# postInstall = '' +# chmod +x "$out/bin/superapp" +# ''; +# passthru.updateScript = gitUpdater {}; +# meta = { +# description = "Super app that will save the world"; +# homepage = "https://github.com/sortugdev/superapp"; +# license = lib.licenses.asl20; +# maintainers = with lib.maintainers; [pepe]; +# platforms = lib.platforms.all; +# mainProgram = "superapp"; +# }; +# }) +{ + lib, + buildNpmPackage, + fetchFromGitHub, + fetchNpmDeps, + gitUpdater, +}: +buildNpmPackage (finalAttrs: { + pname = "gemini-cli"; + version = "0.1.7"; + src = fetchFromGitHub { + owner = "google-gemini"; + repo = "gemini-cli"; + tag = "v${finalAttrs.version}"; + hash = "sha256-DAenod/w9BydYdYsOnuLj7kCQRcTnZ81tf4MhLUug6c="; + }; + npmDeps = fetchNpmDeps { + inherit (finalAttrs) src; + hash = "sha256-otogkSsKJ5j1BY00y4SRhL9pm7CK9nmzVisvGCDIMlU="; + }; + preConfigure = '' + mkdir -p packages/generated + echo "export const GIT_COMMIT_INFO = { commitHash: '${finalAttrs.src.rev}' };" > packages/generated/git-commit.ts + ''; + installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/gemini-cli} + cp -r node_modules $out/share/gemini-cli/ + rm -f $out/share/gemini-cli/node_modules/@google/gemini-cli + rm -f $out/share/gemini-cli/node_modules/@google/gemini-cli-core + cp -r packages/cli $out/share/gemini-cli/node_modules/@google/gemini-cli + cp -r packages/core $out/share/gemini-cli/node_modules/@google/gemini-cli-core + ln -s $out/share/gemini-cli/node_modules/@google/gemini-cli/dist/index.js $out/bin/gemini + runHook postInstall + ''; + postInstall = '' + chmod +x "$out/bin/gemini" + ''; + passthru.updateScript = gitUpdater {}; + meta = { + description = "AI agent that brings the power of Gemini directly into your terminal"; + homepage = "https://github.com/google-gemini/gemini-cli"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [donteatoreo]; + platforms = lib.platforms.all; + mainProgram = "gemini"; + }; +}) diff --git a/derivations/gemini/flake.nix b/derivations/gemini/flake.nix new file mode 100644 index 0000000..9dd913d --- /dev/null +++ b/derivations/gemini/flake.nix @@ -0,0 +1,20 @@ +{ + description = "Gemini CLI flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { + self, + nixpkgs, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.${system}.default = pkgs.callPackage ./default.nix { + inherit (pkgs) lib buildNpmPackage fetchFromGitHub fetchNpmDeps gitUpdater; + inherit nixpkgs; + }; + }; +} |