diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..db686c5 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1767313136, + "narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..49bbfb6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,55 @@ +{ + description = "Git-backed issue tracker for AI agents"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + runtimeDeps = with pkgs; [ + coreutils + findutils + gawk + gnused + gnugrep + ripgrep + jq + ]; + in + { + packages.ticket = pkgs.stdenvNoCC.mkDerivation { + pname = "ticket"; + version = self.shortRev or self.dirtyShortRev or "dev"; + src = ./.; + + nativeBuildInputs = [ pkgs.makeWrapper ]; + + dontBuild = true; + + installPhase = '' + install -Dm755 ticket $out/libexec/tk + install -Dm644 LICENSE $out/share/licenses/ticket/LICENSE + + makeWrapper $out/libexec/tk $out/bin/tk \ + --prefix PATH : ${pkgs.lib.makeBinPath runtimeDeps} + + # Install plugins + for plugin in plugins/ticket-*; do + [ -L "$plugin" ] && continue + install -Dm755 "$plugin" "$out/bin/$(basename "$plugin")" + done + install -Dm755 plugins/ticket-ls "$out/bin/ticket-list" + ''; + }; + } + ) // { + overlays.ticket = final: prev: { + ticket = self.packages.${final.system}.ticket; + }; + }; +}