build: support pkg managers installation (#87)
closes #71, #84, #86 - AUR - Homebrew - Nix - Debian (.deb) - RPM (.rpm) - Aqua - ASDF This is my first time doing this, so there might be mistakes. If you can't download it through any pkg manager, please leave a comment or open an issue --------- Co-authored-by: use-the-fork <23747916+use-the-fork@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# Watch flake.nix for changes.
|
||||
watch_file flake.nix
|
||||
|
||||
# Disable builders for trivial flake actions, such as direnv reload.
|
||||
# Helps us reduce overhead introduced by a redundant network request.
|
||||
if ! NIX_CONFIG="builders =" use flake . ; then
|
||||
echo "Default shell could not be loaded." >&2
|
||||
return 1
|
||||
fi
|
||||
@@ -1,93 +1,64 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches: [ '**' ]
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "v*"
|
||||
pull_request:
|
||||
branches: ["**"]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
quality-and-release:
|
||||
name: Quality & Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
quality-and-release:
|
||||
name: Quality & Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.24'
|
||||
cache: true
|
||||
|
||||
- name: Tidy
|
||||
run: go mod tidy
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.24"
|
||||
cache: true
|
||||
|
||||
- name: Run Linter
|
||||
uses: golangci/golangci-lint-action@v8
|
||||
with:
|
||||
version: v2.11.4
|
||||
- name: Tidy
|
||||
run: go mod tidy
|
||||
|
||||
- name: Run Tests
|
||||
run: go test -v ./...
|
||||
- name: Run Linter
|
||||
uses: golangci/golangci-lint-action@v8
|
||||
with:
|
||||
version: v2.11.4
|
||||
|
||||
- name: Build Binaries
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
mkdir -p dist
|
||||
platforms=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64")
|
||||
for platform in "${platforms[@]}"; do
|
||||
os_arch=(${platform//\// })
|
||||
GOOS=${os_arch[0]}
|
||||
GOARCH=${os_arch[1]}
|
||||
output_name="iris"
|
||||
[ "$GOOS" == "windows" ] && output_name="iris.exe"
|
||||
|
||||
echo "Building $GOOS/$GOARCH..."
|
||||
GOOS=$GOOS GOARCH=$GOARCH go build \
|
||||
-ldflags="-s -w -X github.com/versenilvis/iris/root.Version=${{ github.ref_name }}" \
|
||||
-trimpath -o "dist/$output_name" ./cmd/iris
|
||||
|
||||
cd dist
|
||||
tar -czf "iris_${GOOS}_${GOARCH}.tar.gz" "$output_name"
|
||||
rm "$output_name"
|
||||
cd ..
|
||||
done
|
||||
- name: Run Tests
|
||||
run: go test -v ./...
|
||||
|
||||
- name: Prepare Release Notes
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
# Generate standard GitHub release notes
|
||||
GEN_NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes -f tag_name=${{ github.ref_name }} --jq .body)
|
||||
cat <<EOF > release_notes.md
|
||||
$GEN_NOTES
|
||||
- name: Create vendor tarball
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
go mod vendor
|
||||
tar -czf iris-${GITHUB_REF_NAME#v}-vendor.tar.gz vendor/
|
||||
sha256sum iris-${GITHUB_REF_NAME#v}-vendor.tar.gz > iris-${GITHUB_REF_NAME#v}-vendor.tar.gz.sha256
|
||||
|
||||
## Update
|
||||
\`\`\`bash
|
||||
iris update
|
||||
\`\`\`
|
||||
EOF
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create GitHub Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
name: ${{ github.ref_name }}
|
||||
body_path: release_notes.md
|
||||
files: dist/*.tar.gz
|
||||
generate_release_notes: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Run GoReleaser
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: latest
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
AUR_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
|
||||
|
||||
@@ -8,3 +8,6 @@ docs/code
|
||||
docs/plan
|
||||
todo.txt
|
||||
scratch/
|
||||
.env
|
||||
.byte/
|
||||
dist/
|
||||
@@ -0,0 +1,92 @@
|
||||
version: 2
|
||||
|
||||
project_name: iris
|
||||
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
ldflags:
|
||||
- -s -w -X github.com/versenilvis/iris/root.Version={{.Version}}
|
||||
flags:
|
||||
- -trimpath
|
||||
main: ./cmd/iris
|
||||
binary: iris
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
name_template: >-
|
||||
{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}
|
||||
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
algorithm: sha256
|
||||
|
||||
release:
|
||||
extra_files:
|
||||
- glob: ./iris-*-vendor.tar.gz
|
||||
- glob: ./iris-*-vendor.tar.gz.sha256
|
||||
footer: |
|
||||
## Update
|
||||
```bash
|
||||
iris update
|
||||
```
|
||||
# AUR
|
||||
aurs:
|
||||
- name: iris-bin
|
||||
package: |-
|
||||
install -Dm755 "./iris" "${pkgdir}/usr/bin/iris"
|
||||
install: "scripts/aur.install"
|
||||
homepage: "https://github.com/versenilvis/iris"
|
||||
description: "A highly customizable, blazing fast and context-aware CLI autocomplete/navigation tool"
|
||||
maintainers:
|
||||
- "VERSE <sunnyone0901@gmail.com>"
|
||||
license: "MIT"
|
||||
private_key: "{{ .Env.AUR_KEY }}"
|
||||
git_url: "ssh://aur@aur.archlinux.org/iris.git"
|
||||
commit_author:
|
||||
name: "goreleaserbot"
|
||||
email: "bot@goreleaser.com"
|
||||
commit_msg_template: "AUR release {{ .Tag }}"
|
||||
provides:
|
||||
- iris
|
||||
conflicts:
|
||||
- iris-bin
|
||||
# Homebrew
|
||||
brews:
|
||||
- repository:
|
||||
owner: versenilvis
|
||||
name: homebrew-iris
|
||||
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
|
||||
directory: Formula
|
||||
homepage: "https://github.com/versenilvis/iris"
|
||||
description: "A highly customizable, blazing fast and context-aware CLI autocomplete/navigation tool"
|
||||
license: "MIT"
|
||||
caveats: |
|
||||
To completely remove IRIS configurations and shell hooks,
|
||||
please run 'iris uninstall' BEFORE removing this package, or manually
|
||||
clean up ~/.config/iris and your shell RC files (e.g. ~/.zshrc).
|
||||
test: |
|
||||
system "#{bin}/iris", "--help"
|
||||
|
||||
# Debian/RPM
|
||||
nfpms:
|
||||
- id: iris
|
||||
package_name: iris
|
||||
vendor: "versenilvis"
|
||||
homepage: "https://github.com/versenilvis/iris"
|
||||
maintainer: "VERSE <sunnyone0901@gmail.com>"
|
||||
description: "A highly customizable, blazing fast and context-aware CLI autocomplete/navigation tool"
|
||||
license: "MIT"
|
||||
file_name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
|
||||
scripts:
|
||||
prerm: "scripts/prerm.sh"
|
||||
formats:
|
||||
- deb
|
||||
- rpm
|
||||
bindir: /usr/bin
|
||||
@@ -2,13 +2,13 @@
|
||||
<!-- <img width="50%" alt="banner" src="https://github.com/user-attachments/assets/c5ec623b-8259-473f-b7c3-3d01a64deb5d" /> -->
|
||||
<!-- <img width="25%" alt="logo" src="https://github.com/user-attachments/assets/79d3913c-56b7-42cb-8b07-53e98f39322b" /> -->
|
||||
<img width="15%" alt="logo" src="https://github.com/user-attachments/assets/10b7ca98-872b-44a2-bdcd-265f18aa0564" />
|
||||
|
||||
|
||||
<!-- <h1>IRIS</h1> -->
|
||||
<p>IRIS (Intelligent Real-time Input Suggestion) - A shell auto-completion tool that works like code editor's IntelliSense</p>
|
||||
|
||||
[](https://www.apple.com/macos/)
|
||||
[](https://www.kernel.org/)
|
||||
<br>
|
||||
|
||||
[](https://www.apple.com/macos/)
|
||||
[](https://www.kernel.org/)
|
||||
<br>
|
||||
<!--[](https://github.com/versenilvis/IRIS/actions/workflows/release.yml)-->
|
||||
[]()
|
||||
[](./LICENSE)
|
||||
@@ -38,6 +38,7 @@ Run iris wherever you already work; your local machine, a remote server, or anyw
|
||||
-->
|
||||
|
||||
## AI suggestions
|
||||
|
||||
<div align="center">
|
||||
<img width="1920" height="1080" alt="output" src="https://github.com/user-attachments/assets/ab80fe75-b5dd-4acd-84bb-45bca17ee3b7" />
|
||||
<i>IRIS has AI suggestions like your code editor (API key/Local)</i>
|
||||
@@ -46,7 +47,7 @@ Run iris wherever you already work; your local machine, a remote server, or anyw
|
||||
## Why IRIS instead of Fig
|
||||
|
||||
> [!IMPORTANT]
|
||||
> **[Fig](https://app.fig.io/) was officially sunset in September 2024 and migrated to Amazon Q Developer (which requires cloud authentication and proprietary bloat)**
|
||||
> **[Fig](https://app.fig.io/) was officially sunset in September 2024 and migrated to Amazon Q Developer (which requires cloud authentication and proprietary bloat)**
|
||||
> **IRIS is the lightweight, open-source, zero-telemetry alternative built purely on native Go and TTY with no accounts, no GUI app, and no background daemons required**
|
||||
|
||||
### How it compares
|
||||
@@ -83,20 +84,135 @@ Shell plugins are great, but they also come with trade-offs. And also, not every
|
||||
- Terminal emulator with ANSI color support
|
||||
- Go 1.24 or newer (if building from source)
|
||||
|
||||
> [!WARNING]
|
||||
> Currently, Windows is not supported
|
||||
|
||||
#### Method 1: Install script (recommended)
|
||||
#### Method 1: Package managers
|
||||
|
||||
<details>
|
||||
<summary><b>Arch Linux (AUR)</b></summary>
|
||||
<br>
|
||||
|
||||
IRIS is available on the Arch User Repository. You can install it using your favorite AUR helper:
|
||||
|
||||
```bash
|
||||
yay -S iris-bin
|
||||
```
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>macOS / Linux (Homebrew)</b></summary>
|
||||
<br>
|
||||
|
||||
Install IRIS via Homebrew tap:
|
||||
|
||||
```bash
|
||||
brew install versenilvis/iris/iris
|
||||
```
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>Nix Flakes</b></summary>
|
||||
<br>
|
||||
|
||||
If you are using Nix Flakes, you can consume this module directly without building it manually.
|
||||
|
||||
1. In your `flake.nix` inputs, add:
|
||||
|
||||
```nix
|
||||
iris.url = "github:versenilvis/iris/main";
|
||||
```
|
||||
|
||||
2. Then, use one of the following options to add IRIS to your system:
|
||||
|
||||
**Option A: Try without installing (ephemeral)**
|
||||
```bash
|
||||
nix run github:versenilvis/iris
|
||||
```
|
||||
|
||||
**Option B: Install to your user profile**
|
||||
```bash
|
||||
nix profile install github:versenilvis/iris
|
||||
```
|
||||
|
||||
**Option C: Using Home Manager**
|
||||
*(Ensure you pass `inputs` to modules via `extraSpecialArgs`)*
|
||||
```nix
|
||||
home.packages = [ inputs.iris.packages.${pkgs.system}.default ];
|
||||
```
|
||||
|
||||
**Option D: Without Home Manager (NixOS System)**
|
||||
*(Ensure you pass `inputs` to modules via `specialArgs`)*
|
||||
```nix
|
||||
environment.systemPackages = [ inputs.iris.packages.${pkgs.system}.default ];
|
||||
```
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>Debian / Ubuntu (.deb)</b></summary>
|
||||
<br>
|
||||
|
||||
```bash
|
||||
curl -sLO https://github.com/versenilvis/iris/releases/latest/download/iris_linux_amd64.deb
|
||||
sudo dpkg -i iris_linux_amd64.deb
|
||||
rm iris_linux_amd64.deb
|
||||
```
|
||||
*(For ARM64 architecture, replace `amd64` with `arm64`)*
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>Fedora / RHEL (.rpm)</b></summary>
|
||||
<br>
|
||||
|
||||
```bash
|
||||
curl -sLO https://github.com/versenilvis/iris/releases/latest/download/iris_linux_amd64.rpm
|
||||
sudo rpm -i iris_linux_amd64.rpm
|
||||
rm iris_linux_amd64.rpm
|
||||
```
|
||||
*(For ARM64 architecture, replace `amd64` with `arm64`)*
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>Aqua</b></summary>
|
||||
<br>
|
||||
|
||||
If you use [aqua](https://aquaproj.github.io/), you can install IRIS by adding it to your `aqua.yaml`:
|
||||
|
||||
```yaml
|
||||
packages:
|
||||
- name: versenilvis/iris
|
||||
```
|
||||
|
||||
Then run `aqua i`.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>asdf</b></summary>
|
||||
<br>
|
||||
|
||||
If you use [asdf](https://asdf-vm.com/), you can install IRIS via its plugin:
|
||||
|
||||
```bash
|
||||
asdf plugin add iris https://github.com/versenilvis/asdf-iris.git
|
||||
asdf install iris latest
|
||||
asdf set -u iris latest
|
||||
asdf current iris
|
||||
```
|
||||
</details>
|
||||
|
||||
#### Method 2: Install script (recommended)
|
||||
|
||||
```bash
|
||||
curl -sSL https://raw.githubusercontent.com/versenilvis/iris/main/scripts/install.sh | sh
|
||||
```
|
||||
|
||||
#### Method 2: Go install
|
||||
#### Method 3: Go install
|
||||
|
||||
```bash
|
||||
go install github.com/versenilvis/iris/cmd/iris@latest
|
||||
```
|
||||
|
||||
#### Method 3: Build from source (for developers)
|
||||
#### Method 4: Build from source (for developers)
|
||||
|
||||
```bash
|
||||
git clone https://github.com/versenilvis/iris.git
|
||||
@@ -104,9 +220,6 @@ cd iris
|
||||
just reload
|
||||
```
|
||||
|
||||
> [!WARNING]
|
||||
> Currently, Windows is not supported
|
||||
|
||||
## Uninstall
|
||||
|
||||
To completely uninstall IRIS, remove all configurations, and clean up your shell integration files, simply run:
|
||||
@@ -224,18 +337,19 @@ timeout_ms = 5000
|
||||
| <kbd>↓</kbd> | Navigate down / history | Move the selection down, or open command history when the prompt is empty.|
|
||||
| <kbd>→</kbd> | Accept ghost text | Accept the faded ghost text suggestion when the menu is open. |
|
||||
| <kbd>←</kbd> / <kbd>→</kbd> | Move cursor | Move the cursor inside the input buffer. Disabled when the prompt is empty|
|
||||
| <kbd>Ctrl</kbd> + <kbd>R</kbd> | Switch mode | Toggle between `spec` and `history` mode. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>A</kbd> | Beginning of line | Move the cursor to the start of the command line. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>E</kbd> | End of line | Move the cursor to the end of the command line. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>L</kbd> | Clear screen | Clear the terminal while preserving the input buffer and redrawing the menu. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>U</kbd> | Clear command | Remove the entire current command and close the menu. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>C</kbd> | Cancel command | Send `SIGINT`, clear the input buffer, and close the menu. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>W</kbd> | Delete word | Delete the word immediately before the cursor. |
|
||||
| <kbd>Ctrl/⌘</kbd> + <kbd>R</kbd> | Switch mode | Toggle between `spec` and `history` mode. |
|
||||
| <kbd>Ctrl/⌘</kbd> + <kbd>A</kbd> | Beginning of line | Move the cursor to the start of the command line. |
|
||||
| <kbd>Ctrl/⌘</kbd> + <kbd>E</kbd> | End of line | Move the cursor to the end of the command line. |
|
||||
| <kbd>Ctrl/⌘</kbd> + <kbd>L</kbd> | Clear screen | Clear the terminal while preserving the input buffer and redrawing the menu. |
|
||||
| <kbd>Ctrl/⌘</kbd> + <kbd>U</kbd> | Clear command | Remove the entire current command and close the menu. |
|
||||
| <kbd>Ctrl/⌘</kbd> + <kbd>C</kbd> | Cancel command | Send `SIGINT`, clear the input buffer, and close the menu. |
|
||||
| <kbd>Ctrl/⌘</kbd> + <kbd>W</kbd> | Delete word | Delete the word immediately before the cursor. |
|
||||
|
||||
> [!NOTE]
|
||||
> With <kbd>Ctrl</kbd> + <kbd>A</kbd>, <kbd>Ctrl</kbd> + <kbd>E</kbd>, <kbd>Ctrl</kbd> + <kbd>W</kbd>, <kbd>Ctrl</kbd> + <kbd>U</kbd>, <kbd>Ctrl</kbd> + <kbd>L</kbd>, and <kbd>Ctrl</kbd> + <kbd>C</kbd>: they belong to your shell by default. IRIS handles them directly in raw mode so your cursor and menu stay in sync
|
||||
> With <kbd>Ctrl/⌘</kbd> + <kbd>A</kbd>, <kbd>Ctrl/⌘</kbd> + <kbd>E</kbd>, <kbd>Ctrl/⌘</kbd> + <kbd>W</kbd>, <kbd>Ctrl/⌘</kbd> + <kbd>U</kbd>, <kbd>Ctrl/⌘</kbd> + <kbd>L</kbd>, and <kbd>Ctrl/⌘</kbd> + <kbd>C</kbd>: they belong to your shell by default. IRIS handles them directly in raw mode so your cursor and menu stay in sync
|
||||
|
||||
## Theme
|
||||
|
||||
<div align="center">
|
||||
<img width="1920" height="1080" alt="Kitty terminal showcase" src="https://github.com/user-attachments/assets/d45cf36e-6d7d-437a-9af9-28cd994bf55f" />
|
||||
😺 <i>Kitty terminal</i>
|
||||
@@ -300,6 +414,7 @@ Thank you!
|
||||
I'd love to hear your feedback
|
||||
|
||||
Feel free to reach out via:
|
||||
* [Email](mailto:versedev.store@proton.me)
|
||||
* [Twitter](https://twitter.com/versenilvis)
|
||||
* [GitHub issues](https://github.com/versenilvis/iris/issues/new)
|
||||
|
||||
- [Email](mailto:versedev.store@proton.me)
|
||||
- [Twitter](https://twitter.com/versenilvis)
|
||||
- [GitHub issues](https://github.com/versenilvis/iris/issues/new)
|
||||
|
||||
Generated
+51
-1
@@ -1,5 +1,23 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1782949081,
|
||||
"narHash": "sha256-vp6Y/Grm98ESt6ceOkWiHWyZRDV3J1RID4w+6NWK9yA=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "17c9d6cdfc60c64f4ee8d306f9bc0b4ccb51481e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1785090369,
|
||||
@@ -16,9 +34,41 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1782614948,
|
||||
"narHash": "sha256-ePjCwr1sNm9NYUqywL7QfK3JnlS015msC+eBu2zKlp8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "db3f255737b94216eb71cce308e2912cf6bc2d7c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,52 +1,66 @@
|
||||
{
|
||||
description = "IRIS - Shell commands suggestion tool";
|
||||
|
||||
inputs = {
|
||||
systems.url = "github:nix-systems/default";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
pkgsFor = system: nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
outputs = inputs @ {flake-parts, ...}:
|
||||
flake-parts.lib.mkFlake
|
||||
{
|
||||
packages = forAllSystems (system:
|
||||
let
|
||||
pkgs = pkgsFor system;
|
||||
in
|
||||
{
|
||||
iris = pkgs.buildGoModule {
|
||||
pname = "iris";
|
||||
version = self.shortRev or "dirty";
|
||||
src = ./.;
|
||||
inherit inputs;
|
||||
}
|
||||
(
|
||||
{
|
||||
inputs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
systems = import inputs.systems;
|
||||
perSystem = {
|
||||
pkgs,
|
||||
self',
|
||||
...
|
||||
}: {
|
||||
packages = {
|
||||
iris = pkgs.buildGoModule {
|
||||
pname = "iris";
|
||||
version = self.shortRev or "dirty";
|
||||
src = pkgs.lib.cleanSource ./.;
|
||||
|
||||
subPackages = [ "cmd/iris" ];
|
||||
subPackages = ["cmd/iris"];
|
||||
|
||||
proxyVendor = true;
|
||||
vendorHash = "sha256-kBSMhUsuCKIjAXjGfl1WSjCX+tlGi9BTnkRu9ScW6M0=";
|
||||
proxyVendor = true;
|
||||
vendorHash = "sha256-kBSMhUsuCKIjAXjGfl1WSjCX+tlGi9BTnkRu9ScW6M0=";
|
||||
|
||||
doCheck = false;
|
||||
doCheck = false;
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "A shell auto-completion tool that works like code editor's IntelliSense";
|
||||
homepage = "https://github.com/versenilvis/iris";
|
||||
license = licenses.mit;
|
||||
mainProgram = "iris";
|
||||
meta = with pkgs.lib; {
|
||||
description = "A highly customizable, blazing fast and context-aware CLI autocomplete/navigation tool";
|
||||
homepage = "https://github.com/versenilvis/iris";
|
||||
license = licenses.mit;
|
||||
mainProgram = "iris";
|
||||
};
|
||||
};
|
||||
default = self'.packages.iris;
|
||||
};
|
||||
default = self.packages.${system}.iris;
|
||||
});
|
||||
|
||||
devShells = forAllSystems (system:
|
||||
let
|
||||
pkgs = pkgsFor system;
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [ go ];
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
# Tell Direnv to shut up.
|
||||
DIRENV_LOG_FORMAT = "";
|
||||
|
||||
packages = [
|
||||
# languages
|
||||
pkgs.go
|
||||
pkgs.pkl
|
||||
|
||||
# Tooling
|
||||
pkgs.hk
|
||||
pkgs.just
|
||||
pkgs.alejandra
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
amends "package://github.com/jdx/hk/releases/download/v1.50.0/hk@1.50.0#/Config.pkl"
|
||||
|
||||
import "package://github.com/jdx/hk/releases/download/v1.50.0/hk@1.50.0#/Builtins.pkl"
|
||||
|
||||
local linters = new {
|
||||
["pkl"] = Builtins.pkl
|
||||
}
|
||||
|
||||
local formatter = new {
|
||||
["newlines"] = Builtins.newlines
|
||||
["fix-smart-quotes"] = Builtins.fix_smart_quotes
|
||||
["alejandra"] = (Builtins.alejandra) {
|
||||
exclude = List("**/npins/default.nix")
|
||||
}
|
||||
["pkl-format"] = Builtins.pkl_format
|
||||
["just-format"] = Builtins.just_format
|
||||
}
|
||||
|
||||
hooks {
|
||||
["pre-commit"] {
|
||||
fix = true
|
||||
stash = "git"
|
||||
steps {
|
||||
...linters
|
||||
...formatter
|
||||
}
|
||||
}
|
||||
["fix"] {
|
||||
fix = true
|
||||
steps {
|
||||
...linters
|
||||
...formatter
|
||||
}
|
||||
}
|
||||
["check"] {
|
||||
steps {
|
||||
...linters
|
||||
...formatter
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
packages:
|
||||
- type: github_release
|
||||
repo_owner: versenilvis
|
||||
repo_name: iris
|
||||
description: "A highly customizable, blazing fast and context-aware CLI autocomplete/navigation tool"
|
||||
asset: "iris_{{.OS}}_{{.Arch}}.{{.Format}}"
|
||||
format: tar.gz
|
||||
bin:
|
||||
- iris
|
||||
checksum:
|
||||
type: github_release
|
||||
asset: checksums.txt
|
||||
file_format: regexp
|
||||
algorithm: sha256
|
||||
pattern:
|
||||
checksum: ^(\b[A-Fa-f0-9]{64}\b)
|
||||
file: "^\\b[A-Fa-f0-9]{64}\\b\\s+(.*)$"
|
||||
@@ -0,0 +1,12 @@
|
||||
BSD Zero Clause License
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
[ -n "$ASDF_INSTALL_VERSION" ] || { echo "ASDF_INSTALL_VERSION is required" >&2; exit 1; }
|
||||
[ -n "$ASDF_DOWNLOAD_PATH" ] || { echo "ASDF_DOWNLOAD_PATH is required" >&2; exit 1; }
|
||||
|
||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
ARCH=$(uname -m)
|
||||
|
||||
case "$ARCH" in
|
||||
x86_64) ARCH="amd64" ;;
|
||||
aarch64) ARCH="arm64" ;;
|
||||
esac
|
||||
|
||||
URL="https://github.com/versenilvis/iris/releases/download/v${ASDF_INSTALL_VERSION}/iris_${OS}_${ARCH}.tar.gz"
|
||||
|
||||
echo "Downloading Iris from $URL"
|
||||
curl -sSL "$URL" -o "$ASDF_DOWNLOAD_PATH/iris.tar.gz"
|
||||
tar -xzf "$ASDF_DOWNLOAD_PATH/iris.tar.gz" -C "$ASDF_DOWNLOAD_PATH"
|
||||
rm "$ASDF_DOWNLOAD_PATH/iris.tar.gz"
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
[ -n "$ASDF_INSTALL_PATH" ] || { echo "ASDF_INSTALL_PATH is required" >&2; exit 1; }
|
||||
[ -n "$ASDF_DOWNLOAD_PATH" ] || { echo "ASDF_DOWNLOAD_PATH is required" >&2; exit 1; }
|
||||
|
||||
mkdir -p "$ASDF_INSTALL_PATH/bin"
|
||||
cp "$ASDF_DOWNLOAD_PATH/iris" "$ASDF_INSTALL_PATH/bin/iris"
|
||||
chmod +x "$ASDF_INSTALL_PATH/bin/iris"
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
git ls-remote --tags --refs "https://github.com/versenilvis/iris.git" \
|
||||
| grep -o 'refs/tags/v[0-9].*' \
|
||||
| cut -d/ -f3- \
|
||||
| sed 's/^v//' \
|
||||
| sort -t. -k 1,1n -k 2,2n -k 3,3n
|
||||
@@ -0,0 +1,9 @@
|
||||
pre_remove() {
|
||||
echo ""
|
||||
echo "========================================================================="
|
||||
echo " WARNING: To completely remove IRIS configurations and shell hooks,"
|
||||
echo " please run 'iris uninstall' BEFORE removing this package, or manually"
|
||||
echo " clean up ~/.config/iris and your shell RC files (e.g. ~/.zshrc)."
|
||||
echo "========================================================================="
|
||||
echo ""
|
||||
}
|
||||
+1
-1
@@ -155,7 +155,7 @@ get_download_url() {
|
||||
err "GitHub API error (HTTP ${http_code}): ${msg}"
|
||||
fi
|
||||
|
||||
url=$(echo "${releases}" | grep "browser_download_url" | grep "${arch}" | head -1 | cut -d '"' -f 4)
|
||||
url=$(echo "${releases}" | grep "browser_download_url" | grep "${arch}\.tar\.gz" | head -1 | cut -d '"' -f 4)
|
||||
echo "${url}"
|
||||
}
|
||||
|
||||
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
action="$1"
|
||||
if [ "$action" = "remove" ] || [ "$action" = "0" ]; then
|
||||
echo ""
|
||||
echo "========================================================================="
|
||||
echo " WARNING: To completely remove IRIS configurations and shell hooks,"
|
||||
echo " please run 'iris uninstall' BEFORE removing this package, or manually"
|
||||
echo " clean up ~/.config/iris and your shell RC files (e.g. ~/.zshrc)."
|
||||
echo "========================================================================="
|
||||
echo ""
|
||||
fi
|
||||
Reference in New Issue
Block a user