Skip to content

Commit

Permalink
Merge pull request #299340 from adamcstephens/incus/0.7
Browse files Browse the repository at this point in the history
incus: 0.6 -> 0.7
  • Loading branch information
adamcstephens authored Mar 27, 2024
2 parents 098e283 + a5a4da8 commit 0ca930a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 50 deletions.
1 change: 1 addition & 0 deletions nixos/modules/virtualisation/incus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ in
{
INCUS_LXC_TEMPLATE_CONFIG = "${pkgs.lxcfs}/share/lxc/config";
INCUS_OVMF_PATH = ovmf;
INCUS_USBIDS_PATH = "${pkgs.hwdata}/share/hwdata/usb.ids";
PATH = lib.mkForce serverBinPath;
}
(lib.mkIf (cfg.ui.enable) { "INCUS_UI" = cfg.ui.package; })
Expand Down
29 changes: 0 additions & 29 deletions pkgs/by-name/in/incus/529.patch

This file was deleted.

4 changes: 1 addition & 3 deletions pkgs/by-name/in/incus/client.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ buildGoModule {
subPackages = [ "cmd/incus" ];

postInstall = ''
# use custom bash completion as it has extra logic for e.g. instance names
installShellCompletion --bash --name incus ./scripts/bash/incus
installShellCompletion --cmd incus \
--bash <($out/bin/incus completion bash) \
--fish <($out/bin/incus completion fish) \
--zsh <($out/bin/incus completion zsh)
'';
Expand Down
10 changes: 1 addition & 9 deletions pkgs/by-name/in/incus/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ buildGoModule rec {
inherit hash;
};

# replace with env var > 0.6 https://github.com/lxc/incus/pull/610
postPatch = ''
substituteInPlace internal/usbid/load.go \
--replace-fail "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
'';

excludedPackages = [
# statically compile these
"cmd/incus-agent"
Expand Down Expand Up @@ -103,10 +97,8 @@ buildGoModule rec {
'';

postInstall = ''
# use custom bash completion as it has extra logic for e.g. instance names
installShellCompletion --bash --name incus ./scripts/bash/incus
installShellCompletion --cmd incus \
--bash <($out/bin/incus completion bash) \
--fish <($out/bin/incus completion fish) \
--zsh <($out/bin/incus completion zsh)
'';
Expand Down
11 changes: 4 additions & 7 deletions pkgs/by-name/in/incus/package.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import ./generic.nix {
hash = "sha256-tGuAS0lZvoYb+TvmCklQ8TADZhbm4w/lhdI0ycS4/0o=";
version = "0.6.0";
vendorHash = "sha256-+WmgLOEBJ/7GF596iiTgyTPxn8l+hE6RVqjLKfCi5rs=";
patches = [
# fix storage bug, fixed in > 0.6
./529.patch
];
hash = "sha256-6TLoua3rooDRyPc5BPYgzU/oeVy6F8h+p3UtKGPZkAE=";
version = "0.7.0";
vendorHash = "sha256-Slw58pszT6sbpxK6/f+ojA+uStt0zSWxztFTm5ovZr8=";
patches = [ ];
}
11 changes: 9 additions & 2 deletions pkgs/by-name/in/incus/update.nu
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ def main [--lts = false, --regex: string] {
let current_version = nix eval --raw -f default.nix $"($attr).version" | str trim

if $latest_tag != $current_version {
print $"Updating: new ($latest_tag) != old ($current_version)"
update-source-version $attr $latest_tag $"--file=($file)"

let oldVendorHash = nix-instantiate . --eval --strict -A $"($attr).goModules.drvAttrs.outputHash" --json | from json
let vendorHash = do { nix-build -A $"($attr).goModules" } | complete | get stderr | lines | str trim | find --regex 'got:[[:space:]]*sha256' | split row ' ' | last
open $file | str replace $oldVendorHash $vendorHash | save --force $file
let checkBuild = do { nix-build -A $"($attr).goModules" } | complete
let vendorHash = $checkBuild.stderr | lines | str trim | find --regex 'got:[[:space:]]*sha256' | split row ' ' | last

if $vendorHash != null {
open $file | str replace $oldVendorHash $vendorHash | save --force $file
} else {
print $checkBuild.stderr
exit 1
}
}

{"lts?": $lts, before: $current_version, after: $latest_tag}
Expand Down

0 comments on commit 0ca930a

Please sign in to comment.