incus: add support for multiple releases
Incus LTS will be added in a few months, and this prepares for maintaining two releases
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
version = "0.5.1";
|
||||
hash = "sha256-3eWkQT2P69ZfN62H9B4WLnmlUOGkpzRR0rctgchP+6A=";
|
||||
vendorHash = "sha256-2ZJU7WshN4UIbJv55bFeo9qiAQ/wxu182mnz7pE60xA=";
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
lts ? false,
|
||||
|
||||
lib,
|
||||
callPackage,
|
||||
linkFarm,
|
||||
@@ -38,7 +40,7 @@
|
||||
xz,
|
||||
}:
|
||||
let
|
||||
incus-unwrapped = callPackage ./unwrapped.nix { };
|
||||
unwrapped = callPackage ./unwrapped.nix { inherit lts; };
|
||||
|
||||
binPath = lib.makeBinPath [
|
||||
acl
|
||||
@@ -147,9 +149,9 @@ let
|
||||
];
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "incus-${incus-unwrapped.version}";
|
||||
name = "incus-${unwrapped.version}";
|
||||
|
||||
paths = [ incus-unwrapped ];
|
||||
paths = [ unwrapped ];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
@@ -160,9 +162,10 @@ symlinkJoin {
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit (incus-unwrapped) tests;
|
||||
unwrapped = incus-unwrapped;
|
||||
inherit (unwrapped) tests;
|
||||
|
||||
unwrapped = unwrapped;
|
||||
};
|
||||
|
||||
inherit (incus-unwrapped) meta pname version;
|
||||
inherit (unwrapped) meta pname version;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
lts ? false,
|
||||
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
@@ -15,28 +17,34 @@
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
let
|
||||
releaseFile = if lts then ./lts.nix else ./latest.nix;
|
||||
inherit (import releaseFile) version hash vendorHash;
|
||||
in
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "incus-unwrapped";
|
||||
version = "0.5.1";
|
||||
|
||||
inherit vendorHash version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lxc";
|
||||
repo = "incus";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-3eWkQT2P69ZfN62H9B4WLnmlUOGkpzRR0rctgchP+6A=";
|
||||
inherit hash;
|
||||
};
|
||||
|
||||
vendorHash = "sha256-2ZJU7WshN4UIbJv55bFeo9qiAQ/wxu182mnz7pE60xA=";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace internal/usbid/load.go \
|
||||
--replace "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
|
||||
'';
|
||||
|
||||
excludedPackages = [
|
||||
# statically compile these
|
||||
"cmd/incus-agent"
|
||||
"cmd/incus-migrate"
|
||||
"cmd/lxd-to-incus"
|
||||
|
||||
# oidc test requires network
|
||||
"test/mini-oidc"
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user