mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-17 06:06:13 +03:00
incus: add statically compiled client
The incus client can be used from non-Linux systems, and as a standalone binary. Therefore, compile the client separately, and give it a separate passthru so users can install `incus.client`.
This commit is contained in:
parent
cf372500be
commit
a55e16ad8d
53
pkgs/by-name/in/incus/client.nix
Normal file
53
pkgs/by-name/in/incus/client.nix
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
lts ? false,
|
||||
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
}:
|
||||
let
|
||||
releaseFile = if lts then ./lts.nix else ./latest.nix;
|
||||
inherit (import releaseFile) version hash vendorHash;
|
||||
in
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "incus-client";
|
||||
|
||||
inherit vendorHash version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lxc";
|
||||
repo = "incus";
|
||||
rev = "refs/tags/v${version}";
|
||||
inherit hash;
|
||||
};
|
||||
|
||||
CGO_ENABLED = 0;
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
subPackages = [ "cmd/incus" ];
|
||||
|
||||
postInstall = ''
|
||||
# use custom bash completion as it has extra logic for e.g. instance names
|
||||
installShellCompletion --bash --name incus ./scripts/bash/incus
|
||||
|
||||
installShellCompletion --cmd incus \
|
||||
--fish <($out/bin/incus completion fish) \
|
||||
--zsh <($out/bin/incus completion zsh)
|
||||
'';
|
||||
|
||||
# don't run the full incus test suite
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "Powerful system container and virtual machine manager";
|
||||
homepage = "https://linuxcontainers.org/incus";
|
||||
changelog = "https://github.com/lxc/incus/releases/tag/v${version}";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = lib.teams.lxc.members;
|
||||
platforms = lib.platforms.unix;
|
||||
mainProgram = "incus";
|
||||
};
|
||||
}
|
@ -41,6 +41,7 @@
|
||||
}:
|
||||
let
|
||||
unwrapped = callPackage ./unwrapped.nix { inherit lts; };
|
||||
client = callPackage ./client.nix { inherit lts; };
|
||||
|
||||
binPath = lib.makeBinPath [
|
||||
acl
|
||||
@ -164,6 +165,8 @@ symlinkJoin {
|
||||
passthru = {
|
||||
inherit (unwrapped) tests;
|
||||
|
||||
client = client;
|
||||
|
||||
unwrapped = unwrapped;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user