feat(nix): add Nix flake for NixOS support (#52)

- Suppport NixOS
This commit is contained in:
VERSE
2026-07-28 22:00:01 +07:00
committed by GitHub
parent ebb0bead7d
commit 69fb77910d
2 changed files with 79 additions and 0 deletions
Generated
+27
View File
@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1785090369,
"narHash": "sha256-m0pDuRJG7EDo9ri+4Ksu83VsI+PlxNC9lNBfydejce4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "624af665418d3c65d544145b4d34ad696439570e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+52
View File
@@ -0,0 +1,52 @@
{
description = "IRIS - Shell commands suggestion tool";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
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
{
packages = forAllSystems (system:
let
pkgs = pkgsFor system;
in
{
iris = pkgs.buildGoModule {
pname = "iris";
version = self.shortRev or "dirty";
src = ./.;
subPackages = [ "cmd/iris" ];
proxyVendor = true;
vendorHash = "sha256-kBSMhUsuCKIjAXjGfl1WSjCX+tlGi9BTnkRu9ScW6M0=";
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";
};
};
default = self.packages.${system}.iris;
});
devShells = forAllSystems (system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [ go ];
};
});
};
}