Loading nixos/tests/incus/incus-tests.nix +23 −28 Original line number Diff line number Diff line Loading @@ -201,7 +201,8 @@ in server.succeed("systemctl --no-pager -l status apparmor.service") server.wait_for_unit("apparmor.service") '' + lib.optionalString cfg.feature.user ( + lib.optionalString cfg.feature.user # python '' with subtest("incus-user allows restricted access for users"): Loading @@ -211,13 +212,8 @@ in server.succeed("incus project show user-1000") # user can create an instance server.succeed("su - testuser bash -c 'incus create --empty'") '' + lib.optionalString (lib.versionOlder cfg.package.version "6.21") '' # users shouldn't be able to list storage pools server.fail("su - testuser bash -c 'incus storage list'") '' + lib.optionalString (lib.versionAtLeast cfg.package.version "6.21") '' # users shouldn't be able to read storage pools # users should be able to read storage pools server.succeed("su - testuser bash -c 'incus storage list'") # pre-check that there is a pool source Loading @@ -228,6 +224,5 @@ in code, pool_source = server.execute("su - testuser bash -c 'incus storage get default source'") assert pool_source.strip() == "", f"Expected empty string, got {pool_source}" '' ) + instanceScript; } pkgs/by-name/in/incus/generic.nix +4 −15 Original line number Diff line number Diff line Loading @@ -113,14 +113,10 @@ buildGoModule (finalAttrs: { # add our lxc location to incus's acceptable rootFsPaths # this is necessary for tmpfs/tmpfs-overlay to work postPatch = if (lib.versionAtLeast finalAttrs.version "6.16") then '' postPatch = '' substituteInPlace internal/server/device/disk.go \ --replace-fail '"/opt/incus/lib/lxc/rootfs/"' '"${lxc}/lib/lxc/rootfs/"' '' else null; ''; postBuild = '' # build docs Loading Loading @@ -172,16 +168,9 @@ buildGoModule (finalAttrs: { --zsh <($out/bin/incus completion zsh) mkdir -p $agent_loader/bin $agent_loader/etc/systemd/system $agent_loader/lib/udev/rules.d '' + lib.optionalString (lib.versionOlder finalAttrs.version "6.18") '' cp internal/server/instance/drivers/agent-loader/incus-agent{,-setup} $agent_loader/bin/ '' + lib.optionalString (lib.versionAtLeast finalAttrs.version "6.18") '' # the agent_loader output is used by virtualisation.incus.agent cp internal/server/instance/drivers/agent-loader/incus-agent-linux $agent_loader/bin/incus-agent cp internal/server/instance/drivers/agent-loader/incus-agent-setup-linux $agent_loader/bin/incus-agent-setup '' + '' chmod +x $agent_loader/bin/incus-agent{,-setup} patchShebangs $agent_loader/bin/incus-agent{,-setup} cp internal/server/instance/drivers/agent-loader/systemd/incus-agent.service $agent_loader/etc/systemd/system/ Loading pkgs/by-name/in/incus/lts.nix +3 −12 Original line number Diff line number Diff line import ./generic.nix { hash = "sha256-Sg3+399EgwEcZ8fp9cb2KEWQtBpYr5PkwTdnGl/AdfA"; version = "6.0.5-unstable-2026-01-23"; rev = "f8da60633e493bb5c0521981fa031bc909988c95"; vendorHash = "sha256-KOJqPvp+w7G505ZMJ1weRD2SATmfq1aeyCqmbJ6WMAY="; hash = "sha256-DgPSH5t1Zx2X9T8dbpz54M5nXNcCJbdfcq9AEd8kmYo="; version = "6.0.6"; vendorHash = "sha256-bVJwg9VaiSgfpKo+e2oMsYgmaKk42dktq0pahcfbjp0="; patches = [ # qemu 9.1 compat, remove when added to LTS ./572afb06f66f83ca95efa1b9386fceeaa1c9e11b.patch ./0c37b7e3ec65b4d0e166e2127d9f1835320165b8.patch # post 6.0.5 patches, remove >= 6.0.6 # ./c5359c809836c0f3b1e6022bf0528bb90ce06ad7.patch # ./57096066959c843e1c413c4a97f64077b95cb397.patch # ./f3dc9c0e6b77bb8765b347564702e026c2a8f9c6.patch # ./d6a1ea3912938dae740cf821cd070e66e7a623ff.patch # ./d6f0a77dd26df4c1ced80ffa63848279fd4330cc.patch # ./92ac6ac999a4928cfdb92c485a048e4d51f471d0.patch # ./f8da60633e493bb5c0521981fa031bc909988c95,patch ]; lts = true; nixUpdateExtraArgs = [ Loading Loading
nixos/tests/incus/incus-tests.nix +23 −28 Original line number Diff line number Diff line Loading @@ -201,7 +201,8 @@ in server.succeed("systemctl --no-pager -l status apparmor.service") server.wait_for_unit("apparmor.service") '' + lib.optionalString cfg.feature.user ( + lib.optionalString cfg.feature.user # python '' with subtest("incus-user allows restricted access for users"): Loading @@ -211,13 +212,8 @@ in server.succeed("incus project show user-1000") # user can create an instance server.succeed("su - testuser bash -c 'incus create --empty'") '' + lib.optionalString (lib.versionOlder cfg.package.version "6.21") '' # users shouldn't be able to list storage pools server.fail("su - testuser bash -c 'incus storage list'") '' + lib.optionalString (lib.versionAtLeast cfg.package.version "6.21") '' # users shouldn't be able to read storage pools # users should be able to read storage pools server.succeed("su - testuser bash -c 'incus storage list'") # pre-check that there is a pool source Loading @@ -228,6 +224,5 @@ in code, pool_source = server.execute("su - testuser bash -c 'incus storage get default source'") assert pool_source.strip() == "", f"Expected empty string, got {pool_source}" '' ) + instanceScript; }
pkgs/by-name/in/incus/generic.nix +4 −15 Original line number Diff line number Diff line Loading @@ -113,14 +113,10 @@ buildGoModule (finalAttrs: { # add our lxc location to incus's acceptable rootFsPaths # this is necessary for tmpfs/tmpfs-overlay to work postPatch = if (lib.versionAtLeast finalAttrs.version "6.16") then '' postPatch = '' substituteInPlace internal/server/device/disk.go \ --replace-fail '"/opt/incus/lib/lxc/rootfs/"' '"${lxc}/lib/lxc/rootfs/"' '' else null; ''; postBuild = '' # build docs Loading Loading @@ -172,16 +168,9 @@ buildGoModule (finalAttrs: { --zsh <($out/bin/incus completion zsh) mkdir -p $agent_loader/bin $agent_loader/etc/systemd/system $agent_loader/lib/udev/rules.d '' + lib.optionalString (lib.versionOlder finalAttrs.version "6.18") '' cp internal/server/instance/drivers/agent-loader/incus-agent{,-setup} $agent_loader/bin/ '' + lib.optionalString (lib.versionAtLeast finalAttrs.version "6.18") '' # the agent_loader output is used by virtualisation.incus.agent cp internal/server/instance/drivers/agent-loader/incus-agent-linux $agent_loader/bin/incus-agent cp internal/server/instance/drivers/agent-loader/incus-agent-setup-linux $agent_loader/bin/incus-agent-setup '' + '' chmod +x $agent_loader/bin/incus-agent{,-setup} patchShebangs $agent_loader/bin/incus-agent{,-setup} cp internal/server/instance/drivers/agent-loader/systemd/incus-agent.service $agent_loader/etc/systemd/system/ Loading
pkgs/by-name/in/incus/lts.nix +3 −12 Original line number Diff line number Diff line import ./generic.nix { hash = "sha256-Sg3+399EgwEcZ8fp9cb2KEWQtBpYr5PkwTdnGl/AdfA"; version = "6.0.5-unstable-2026-01-23"; rev = "f8da60633e493bb5c0521981fa031bc909988c95"; vendorHash = "sha256-KOJqPvp+w7G505ZMJ1weRD2SATmfq1aeyCqmbJ6WMAY="; hash = "sha256-DgPSH5t1Zx2X9T8dbpz54M5nXNcCJbdfcq9AEd8kmYo="; version = "6.0.6"; vendorHash = "sha256-bVJwg9VaiSgfpKo+e2oMsYgmaKk42dktq0pahcfbjp0="; patches = [ # qemu 9.1 compat, remove when added to LTS ./572afb06f66f83ca95efa1b9386fceeaa1c9e11b.patch ./0c37b7e3ec65b4d0e166e2127d9f1835320165b8.patch # post 6.0.5 patches, remove >= 6.0.6 # ./c5359c809836c0f3b1e6022bf0528bb90ce06ad7.patch # ./57096066959c843e1c413c4a97f64077b95cb397.patch # ./f3dc9c0e6b77bb8765b347564702e026c2a8f9c6.patch # ./d6a1ea3912938dae740cf821cd070e66e7a623ff.patch # ./d6f0a77dd26df4c1ced80ffa63848279fd4330cc.patch # ./92ac6ac999a4928cfdb92c485a048e4d51f471d0.patch # ./f8da60633e493bb5c0521981fa031bc909988c95,patch ]; lts = true; nixUpdateExtraArgs = [ Loading