Unverified Commit 7343db59 authored by Adam Stephens's avatar Adam Stephens
Browse files

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

parent 0ef18705
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
@@ -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; {