lxd-unwrapped-lts: fetch from github and fix updater

This commit is contained in:
Adam Stephens 2024-07-02 07:59:04 -04:00
parent 0ef1870535
commit 7343db59f1
No known key found for this signature in database

View File

@ -4,7 +4,7 @@
pkg-config,
lxc,
buildGo122Module,
fetchurl,
fetchFromGitHub,
acl,
libcap,
dqlite,
@ -13,8 +13,7 @@
udev,
installShellFiles,
nixosTests,
gitUpdater,
callPackage,
nix-update-script,
}:
buildGo122Module rec {
@ -22,12 +21,14 @@ buildGo122Module rec {
# major/minor are used in updateScript to pin to LTS
version = "5.21.0";
src = fetchurl {
url = "https://github.com/canonical/lxd/releases/download/lxd-${version}/lxd-${version}.tar.gz";
hash = "sha256-vnh+8Jm4Olg+VdAPpGboLSbChdnwsU84IgyzGe4ltg8=";
src = fetchFromGitHub {
owner = "canonical";
repo = "lxd";
rev = "refs/tags/lxd-${version}";
hash = "sha256-PqYlFnyEzdkGZhZwuDhWjPLIH5Ee5qUaVePTheMO/ls=";
};
vendorHash = null;
vendorHash = "sha256-E+707xNqOMd46n+FU4m6AKt33ZklfiAM5SeA4kZBUxw=";
postPatch = ''
substituteInPlace shared/usbid/load.go \
@ -87,11 +88,16 @@ buildGo122Module rec {
installShellCompletion --bash --name lxd ./scripts/bash/lxd-client
'';
passthru.tests.lxd = nixosTests.lxd;
passthru.tests.lxd-to-incus = nixosTests.incus.lxd-to-incus;
passthru.updateScript = gitUpdater {
url = "https://github.com/canonical/lxd.git";
rev-prefix = "lxd-5.21";
passthru = {
tests.lxd = nixosTests.lxd;
tests.lxd-to-incus = nixosTests.incus.lxd-to-incus;
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"lxd-(5.21.*)"
];
};
};
meta = with lib; {