diff --git a/nixos/modules/virtualisation/incus.nix b/nixos/modules/virtualisation/incus.nix index a89d000ed299..1ceaa40cca9d 100644 --- a/nixos/modules/virtualisation/incus.nix +++ b/nixos/modules/virtualisation/incus.nix @@ -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; }) diff --git a/pkgs/by-name/in/incus/529.patch b/pkgs/by-name/in/incus/529.patch deleted file mode 100644 index 5e4156b907ca..000000000000 --- a/pkgs/by-name/in/incus/529.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 32a4beecbf8098fdbb15ef5f36088956922630f7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?St=C3=A9phane=20Graber?= -Date: Fri, 23 Feb 2024 18:47:15 -0500 -Subject: [PATCH] incusd/device/disk: Fix incorrect block volume usage -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Stéphane Graber ---- - internal/server/device/disk.go | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/internal/server/device/disk.go b/internal/server/device/disk.go -index 0d19e21139..4f9a3e7c1b 100644 ---- a/internal/server/device/disk.go -+++ b/internal/server/device/disk.go -@@ -339,6 +339,11 @@ func (d *disk) validateConfig(instConf instance.ConfigReader) error { - var usedBy []string - - err = storagePools.VolumeUsedByInstanceDevices(d.state, d.pool.Name(), storageProjectName, &dbVolume.StorageVolume, true, func(inst db.InstanceArgs, project api.Project, usedByDevices []string) error { -+ // Don't count the current instance. -+ if d.inst != nil && d.inst.Project().Name == inst.Project && d.inst.Name() == inst.Name { -+ return nil -+ } -+ - usedBy = append(usedBy, inst.Name) - - return nil diff --git a/pkgs/by-name/in/incus/client.nix b/pkgs/by-name/in/incus/client.nix index 5d69725ba59d..ecad050f042a 100644 --- a/pkgs/by-name/in/incus/client.nix +++ b/pkgs/by-name/in/incus/client.nix @@ -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) ''; diff --git a/pkgs/by-name/in/incus/generic.nix b/pkgs/by-name/in/incus/generic.nix index f6a8954066c3..cf73d366e10c 100644 --- a/pkgs/by-name/in/incus/generic.nix +++ b/pkgs/by-name/in/incus/generic.nix @@ -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" @@ -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) ''; diff --git a/pkgs/by-name/in/incus/package.nix b/pkgs/by-name/in/incus/package.nix index 40fd52de8617..de85b0310bc9 100644 --- a/pkgs/by-name/in/incus/package.nix +++ b/pkgs/by-name/in/incus/package.nix @@ -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 = [ ]; } diff --git a/pkgs/by-name/in/incus/update.nu b/pkgs/by-name/in/incus/update.nu index 1a0755e8f32d..754da9b59abf 100755 --- a/pkgs/by-name/in/incus/update.nu +++ b/pkgs/by-name/in/incus/update.nu @@ -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}