working opencode flake

This commit is contained in:
2025-07-17 14:37:41 -06:00
parent 11049d9f73
commit 02fce7a22e
2 changed files with 10 additions and 23 deletions

View File

@@ -47,29 +47,16 @@
}; };
}; };
}; };
in { configJson = pkgs.writeTextFile {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ bash glib glib.out uv nodejs_22 opencode ];
};
packages.run = pkgs.writeShellScriptBin "run_flake" ''
mkdir -p ~/.config/opencode
cp ${
self.packages.${system}.config_json
} ~/.config/opencode/opencode.json
${pkgs.opencode}/bin/opencode
'';
packages.config_json = pkgs.writeTextFile {
name = "config.json"; name = "config.json";
text = builtins.toJSON opencodeConfig; text = builtins.toJSON opencodeConfig;
}; };
packages.opencodeInstance = pkgs.stdenv.mkDerivation { in {
name = "opencode"; packages = rec {
buildInputs = [ pkgs.opencode ]; opencode = pkgs.writeShellScriptBin "opencode" ''
installPhase = '' mkdir -p ~/.config/opencode
mkdir -p $out/bin cp ${configJson} ~/.config/opencode/opencode.json
ln -s ${pkgs.opencode}/bin/opencode $out/bin/opencode ${pkgs.opencode}/bin/opencode
mkdir -p $out/config
cp ${self.packages.${system}.config_json} $out/config/opencode.json
''; '';
}; };
}); });

View File

@@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
opencodeFlake = import ../../flakes/opencode; opencodeFlake = builtins.getFlake (toString ../../flakes/opencode);
nixgl = import nixgl = import
(fetchTarball "https://github.com/nix-community/nixGL/archive/main.tar.gz") (fetchTarball "https://github.com/nix-community/nixGL/archive/main.tar.gz")
{ }; { };
@@ -41,8 +41,8 @@ in {
jellyfin-tui jellyfin-tui
firefoxpwa firefoxpwa
bluetui bluetui
nixfmt nixfmt-classic
opencodeFlake.packages.${pkgs.system}.opencodeInstance opencodeFlake.packages.${system}.opencode
]; ];
programs.firefox = { programs.firefox = {