This repository was archived by the owner on Jul 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ description = "IncusScripts CLI" ;
3+
4+ inputs = {
5+ nixpkgs . url = "github:nixos/nixpkgs?ref=nixos-unstable" ;
6+ } ;
7+
8+ outputs = {
9+ self ,
10+ nixpkgs ,
11+ } : let
12+ supportedSystems = [
13+ "aarch64-linux"
14+ "x86_64-linux"
15+ ] ;
16+ forAllSystems = f : nixpkgs . lib . genAttrs supportedSystems ( system : f system ) ;
17+ in {
18+ packages = forAllSystems (
19+ system : let
20+ pkgs = nixpkgs . legacyPackages . ${ system } ;
21+ in {
22+ scripts-cli = pkgs . callPackage ./nix/package.nix { } ;
23+ default = self . packages . ${ system } . scripts-cli ;
24+ }
25+ ) ;
26+ } ;
27+ }
Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ buildGo123Module ,
4+ installShellFiles ,
5+ } :
6+ buildGo123Module rec {
7+ pname = "scripts-cli" ;
8+ version = "latest" ;
9+
10+ src = ./../cli ;
11+
12+ vendorHash = "sha256-iPxabKi33tJH8xQ9gPr9XmT0LcBwxtonnXJlJMnYxjw=" ;
13+ subPackages = [ "." "./cmd" ] ;
14+
15+ nativeBuildInputs = [
16+ installShellFiles
17+ ] ;
18+
19+ postInstall = ''
20+ # Rename the binary from cli to scripts-cli
21+ mv $out/bin/cmd $out/bin/scripts-cli
22+
23+ installShellCompletion --cmd scripts-cli \
24+ --bash <($out/bin/scripts-cli completion bash) \
25+ --fish <($out/bin/scripts-cli completion fish) \
26+ --zsh <($out/bin/scripts-cli completion zsh)
27+ '' ;
28+
29+ env . CGO_ENABLED = 0 ;
30+
31+ ldflags = [
32+ "-X github.com/bketelsen/IncusScripts/cli/cmd/main.commit=${ version } "
33+ ] ;
34+
35+ meta = {
36+ description = "Incus Helper-Scripts" ;
37+ homepage = "https://github.com/bketelsen/IncusScripts" ;
38+ license = lib . licenses . mit ;
39+ mainProgram = "scripts-cli" ;
40+ platforms = lib . platforms . linux ;
41+ } ;
42+ }
You can’t perform that action at this time.
0 commit comments