diff --git a/pkgs/by-name/in/incus/latest.nix b/pkgs/by-name/in/incus/latest.nix index bc4ae13403be..0c0c32ba9af3 100644 --- a/pkgs/by-name/in/incus/latest.nix +++ b/pkgs/by-name/in/incus/latest.nix @@ -1,5 +1,5 @@ { - version = "0.5.1"; hash = "sha256-3eWkQT2P69ZfN62H9B4WLnmlUOGkpzRR0rctgchP+6A="; + version = "0.5.1"; vendorHash = "sha256-2ZJU7WshN4UIbJv55bFeo9qiAQ/wxu182mnz7pE60xA="; } diff --git a/pkgs/by-name/in/incus/package.nix b/pkgs/by-name/in/incus/package.nix index c91d08c2f5a5..8a10f6eef7fd 100644 --- a/pkgs/by-name/in/incus/package.nix +++ b/pkgs/by-name/in/incus/package.nix @@ -42,6 +42,7 @@ let unwrapped = callPackage ./unwrapped.nix { inherit lts; }; client = callPackage ./client.nix { inherit lts; }; + name = "incus${lib.optionalString lts "-lts"}"; binPath = lib.makeBinPath [ acl @@ -150,7 +151,7 @@ let ]; in symlinkJoin { - name = "incus-${unwrapped.version}"; + name = "${name}-${unwrapped.version}"; paths = [ unwrapped ]; @@ -163,11 +164,9 @@ symlinkJoin { ''; passthru = { + inherit client unwrapped; + inherit (unwrapped) tests; - - client = client; - - unwrapped = unwrapped; }; inherit (unwrapped) meta pname version; diff --git a/pkgs/by-name/in/incus/unwrapped.nix b/pkgs/by-name/in/incus/unwrapped.nix index 96bf1a6f6525..73257c583940 100644 --- a/pkgs/by-name/in/incus/unwrapped.nix +++ b/pkgs/by-name/in/incus/unwrapped.nix @@ -4,6 +4,7 @@ lib, buildGoModule, fetchFromGitHub, + writeShellScript, acl, cowsql, hwdata, @@ -13,24 +14,24 @@ sqlite, udev, installShellFiles, - nix-update-script, nixosTests, }: let releaseFile = if lts then ./lts.nix else ./latest.nix; inherit (import releaseFile) version hash vendorHash; + name = "incus${lib.optionalString lts "-lts"}"; in buildGoModule rec { - pname = "incus-unwrapped"; + pname = "${name}-unwrapped"; inherit vendorHash version; src = fetchFromGitHub { owner = "lxc"; repo = "incus"; - rev = "refs/tags/v${version}"; + rev = "v${version}"; inherit hash; }; @@ -102,12 +103,11 @@ buildGoModule rec { passthru = { tests.incus = nixosTests.incus; - updateScript = nix-update-script { - extraArgs = [ - "-vr" - "v(.*)" - ]; - }; + updateScript = writeShellScript "update-incus" '' + nix-update ${name}.unwrapped -vr 'v(.*)' --override-filename pkgs/by-name/in/incus/${ + if lts then "lts" else "latest" + }.nix + ''; }; meta = {