diff --git a/appflakes/octofriend/flake.nix b/appflakes/octofriend/flake.nix new file mode 100644 index 0000000..56cb9db --- /dev/null +++ b/appflakes/octofriend/flake.nix @@ -0,0 +1,61 @@ +{ + description = "Octofriend (synthetic-lab/octofriend) packaged for Nix/NixOS"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + + # Upstream source (not a flake) + octofriend = { + url = "github:synthetic-lab/octofriend"; + flake = false; + }; + }; + + outputs = { self, nixpkgs, flake-utils, octofriend }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + lib = pkgs.lib; + in + { + packages.default = pkgs.buildNpmPackage { + pname = "octofriend"; + version = "git-${builtins.substring 0 7 (octofriend.rev or "unknown")}"; + + src = octofriend; + + # First build will fail telling you the correct value. Paste it here. + npmDepsHash = lib.fakeHash; + + # Ensure a modern node (octofriend is a Node CLI). :contentReference[oaicite:1]{index=1} + nodejs = pkgs.nodejs_22; + + nativeBuildInputs = [ pkgs.makeWrapper ]; + + # If octofriend shells out to git/ssh/etc, keep PATH sane. + postInstall = '' + if [ -x "$out/bin/octofriend" ]; then + wrapProgram "$out/bin/octofriend" \ + --prefix PATH : ${lib.makeBinPath [ pkgs.git pkgs.openssh ]} + fi + # Provide the short alias if upstream didn’t already. + if [ -x "$out/bin/octofriend" ] && [ ! -e "$out/bin/octo" ]; then + ln -s "$out/bin/octofriend" "$out/bin/octo" + fi + ''; + + meta = with lib; { + description = "Octofriend CLI coding assistant"; + homepage = "https://github.com/synthetic-lab/octofriend"; + license = licenses.mit; + mainProgram = "octofriend"; + }; + }; + + apps.default = flake-utils.lib.mkApp { + drv = self.packages.${system}.default; + exePath = "/bin/octofriend"; + }; + }); +} diff --git a/systems/common.nix b/systems/common.nix index 70d0fb2..f86591a 100644 --- a/systems/common.nix +++ b/systems/common.nix @@ -120,6 +120,7 @@ lshw # lshw nvme-cli smartmontools + ripgrep ]; services.flatpak.enable = true;