From bf8a79f1a8e968827db6169278d2cfce63007709 Mon Sep 17 00:00:00 2001 From: Christoph Schmatzler Date: Sat, 23 Aug 2025 19:00:43 +0000 Subject: [PATCH] up Signed-off-by: Christoph Schmatzler --- flake.nix | 10 +--- overlays/opencode.nix | 107 ------------------------------------------ 2 files changed, 2 insertions(+), 115 deletions(-) delete mode 100644 overlays/opencode.nix diff --git a/flake.nix b/flake.nix index 87000e5..5667fc0 100644 --- a/flake.nix +++ b/flake.nix @@ -46,7 +46,6 @@ hostname: let syncthingOverlay = import ./overlays/syncthing-darwin.nix; syncthingModule = (syncthingOverlay null {}).darwinSyncthingModule; - opencodeOverlay = import ./overlays/opencode.nix; in inputs.darwin.lib.darwinSystem { system = "aarch64-darwin"; @@ -61,7 +60,7 @@ syncthingModule { - nixpkgs.overlays = [syncthingOverlay opencodeOverlay]; + nixpkgs.overlays = [syncthingOverlay]; nix-homebrew = { inherit user; @@ -80,9 +79,7 @@ ); flake.nixosConfigurations = inputs.nixpkgs.lib.genAttrs nixosHosts ( - hostname: let - opencodeOverlay = import ./overlays/opencode.nix; - in + hostname: inputs.nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = @@ -92,9 +89,6 @@ }; modules = [ inputs.home-manager.nixosModules.home-manager - { - nixpkgs.overlays = [opencodeOverlay]; - } ./hosts/nixos/${hostname} ]; } diff --git a/overlays/opencode.nix b/overlays/opencode.nix deleted file mode 100644 index 36a22d2..0000000 --- a/overlays/opencode.nix +++ /dev/null @@ -1,107 +0,0 @@ -final: prev: { - opencode = prev.opencode.overrideAttrs (oldAttrs: rec { - version = "0.5.12"; - - src = prev.fetchFromGitHub { - owner = "sst"; - repo = "opencode"; - tag = "v${version}"; - hash = "sha256-iPv6rATpIpf2j81Ud4OSWOt0ZSR0sAYBhBRrQpOH1Bs="; - }; - - tui = prev.buildGoModule { - pname = "opencode-tui"; - inherit version src; - modRoot = "packages/tui"; - vendorHash = "sha256-acDXCL7ZQYW5LnEqbMgDwpTbSgtf4wXnMMVtQI1Dv9s="; - subPackages = ["cmd/opencode"]; - - env.CGO_ENABLED = 0; - - ldflags = [ - "-s" - "-X=main.Version=${version}" - ]; - - installPhase = '' - runHook preInstall - install -Dm755 $GOPATH/bin/opencode $out/bin/tui - runHook postInstall - ''; - }; - - node_modules = prev.stdenvNoCC.mkDerivation { - pname = "opencode-node_modules"; - inherit version src; - - impureEnvVars = - prev.lib.fetchers.proxyImpureEnvVars - ++ [ - "GIT_PROXY_COMMAND" - "SOCKS_SERVER" - ]; - - nativeBuildInputs = [ - prev.bun - prev.writableTmpDirAsHomeHook - ]; - - dontConfigure = true; - - buildPhase = '' - runHook preBuild - - export BUN_INSTALL_CACHE_DIR=$(mktemp -d) - - # Disable post-install scripts to avoid shebang issues - bun install \ - --filter=opencode \ - --force \ - --frozen-lockfile \ - --ignore-scripts \ - --no-progress \ - --production - - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - - mkdir -p $out/node_modules - cp -R ./node_modules $out - - runHook postInstall - ''; - - dontFixup = true; - - outputHash = "sha256-hznCg/7c9uNV7NXTkb6wtn3EhJDkGI7yZmSIA2SqX7g="; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - }; - - buildPhase = '' - runHook preBuild - - bun build \ - --define OPENCODE_TUI_PATH="'${oldAttrs.tui}/bin/tui'" \ - --define OPENCODE_VERSION="'${version}'" \ - --compile \ - --target=${ - { - "aarch64-darwin" = "bun-darwin-arm64"; - "aarch64-linux" = "bun-linux-arm64"; - "x86_64-darwin" = "bun-darwin-x64"; - "x86_64-linux" = "bun-linux-x64"; - }.${ - prev.stdenvNoCC.hostPlatform.system - } - } \ - --outfile=opencode \ - ./packages/opencode/src/index.ts \ - - runHook postBuild - ''; - }); -}