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:
Adam Stephens
2024-02-02 12:58:39 -05:00
parent 42742010df
commit cf372500be
3 changed files with 27 additions and 11 deletions
+5
View File
@@ -0,0 +1,5 @@
{
version = "0.5.1";
hash = "sha256-3eWkQT2P69ZfN62H9B4WLnmlUOGkpzRR0rctgchP+6A=";
vendorHash = "sha256-2ZJU7WshN4UIbJv55bFeo9qiAQ/wxu182mnz7pE60xA=";
}
+9 -6
View File
@@ -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;
}
+13 -5
View File
@@ -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"
];