incus: fix update script

Working with the wrapper causes pain, so to update target
incus.unwrapped, or in the future incus-lts.unwrapped
This commit is contained in:
Adam Stephens 2024-02-02 22:12:15 -05:00
parent 5f087b3221
commit 273b448b6a
No known key found for this signature in database
3 changed files with 14 additions and 15 deletions

View File

@ -1,5 +1,5 @@
{
version = "0.5.1";
hash = "sha256-3eWkQT2P69ZfN62H9B4WLnmlUOGkpzRR0rctgchP+6A=";
version = "0.5.1";
vendorHash = "sha256-2ZJU7WshN4UIbJv55bFeo9qiAQ/wxu182mnz7pE60xA=";
}

View File

@ -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;

View File

@ -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 = {