diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4a847d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..90a0e13 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1689192006, + "narHash": "sha256-QM0f0d8oPphOTYJebsHioR9+FzJcy1QNIzREyubB91U=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2de8efefb6ce7f5e4e75bdf57376a96555986841", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "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..9aa5f32 --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem + (system: + with nixpkgs.legacyPackages.${system}; + { + formatter = nixpkgs-fmt; + packages.default = stdenv.mkDerivation rec { + pname = "chatgpt-shell-cli"; + # https://github.com/0xacx/chatGPT-shell-cli/blob/926587a2234b8ae3754a1db9715f4636205159dc/internal_dev/debmaker.sh#L117 + version = "0.0.1"; + src = self; + + buildInputs = [ + jq + curl + ]; + + installPhase = '' + install -D chatgpt.sh -t $out/bin + ''; + + meta = with lib; { + homepage = "https://github.com/Freed-Wu/chatgpt-shell-cli"; + description = ""; + license = licenses.mit; + maintainers = with maintainers; [ Freed-Wu ]; + platforms = platforms.unix; + }; + }; + } + ); +}