resolve regressions from recent qemu files #432

Merged
kiara merged 3 commits from kiara/fediversity:resolve-qemu-regressions into main 2025-07-11 16:09:29 +02:00
Owner
  • move import to match module classes
  • manually import sources to resolve infinite recursion

closes #431.

- move import to match module classes - manually import sources to resolve infinite recursion closes #431.
@ -2,1 +1,3 @@
let
# pulling this in manually over from module args resolves an infinite recursion
sources = import ../../npins;
Contributor

Aren’t we passing sources as specialArgs already exactly to prevent upwards paths?

Aren’t we passing sources as specialArgs already exactly to prevent upwards paths?
Author
Owner

it used _module.args here, iirc specialArgs may not have been recognized in some of the cases

it used `_module.args` here, iirc `specialArgs` may not have been recognized in some of the cases
Contributor

_module.args can't work for imports so it needs to be specialArgs set in the right place.

`_module.args` can't work for imports so it needs to be `specialArgs` set in the right place.
Author
Owner

suggestions welcome; my repro + failed attempts to solve it (on top of this branch) are as follows:

diff --git a/infra/common/proxmox-qemu-vm.nix b/infra/common/proxmox-qemu-vm.nix
index 7ce22dbf..465b4036 100644
--- a/infra/common/proxmox-qemu-vm.nix
+++ b/infra/common/proxmox-qemu-vm.nix
@@ -1,7 +1,7 @@
-let
-  # pulling this in manually over from module args resolves an infinite recursion
-  sources = import ../../npins;
-in
+{
+  sources,
+  ...
+}:
 {
   _class = "nixos";

diff --git a/infra/flake-part.nix b/infra/flake-part.nix
index 4ad559bc..d8fabd2e 100644
--- a/infra/flake-part.nix
+++ b/infra/flake-part.nix
@@ -27,15 +27,22 @@ let
       _module.args = {
         inherit
           inputs
-          sources
+          # # infinite recursion
+          # sources
           keys
           secrets
           ;
       };
+      # # error: The option `nixops4Deployments.test.resources.garage-configuration.specialArgs' does not exist.
+      # specialArgs = { inherit sources; };

-      nixos.module.imports = [
-        ./common/proxmox-qemu-vm.nix
-      ];
+      nixos.module = {
+        imports = [
+          ./common/proxmox-qemu-vm.nix
+        ];
+        # # won't get picked up
+        # specialArgs = { inherit sources; };
+      };

       imports =
         [
suggestions welcome; my repro + failed attempts to solve it (on top of this branch) are as follows: ```patch diff --git a/infra/common/proxmox-qemu-vm.nix b/infra/common/proxmox-qemu-vm.nix index 7ce22dbf..465b4036 100644 --- a/infra/common/proxmox-qemu-vm.nix +++ b/infra/common/proxmox-qemu-vm.nix @@ -1,7 +1,7 @@ -let - # pulling this in manually over from module args resolves an infinite recursion - sources = import ../../npins; -in +{ + sources, + ... +}: { _class = "nixos"; diff --git a/infra/flake-part.nix b/infra/flake-part.nix index 4ad559bc..d8fabd2e 100644 --- a/infra/flake-part.nix +++ b/infra/flake-part.nix @@ -27,15 +27,22 @@ let _module.args = { inherit inputs - sources + # # infinite recursion + # sources keys secrets ; }; + # # error: The option `nixops4Deployments.test.resources.garage-configuration.specialArgs' does not exist. + # specialArgs = { inherit sources; }; - nixos.module.imports = [ - ./common/proxmox-qemu-vm.nix - ]; + nixos.module = { + imports = [ + ./common/proxmox-qemu-vm.nix + ]; + # # won't get picked up + # specialArgs = { inherit sources; }; + }; imports = [ ```
kiara marked this conversation as resolved
kiara force-pushed resolve-qemu-regressions from 3381ff8570
Some checks failed
/ check-pre-commit (pull_request) Successful in 16s
/ check-data-model (pull_request) Failing after 2s
/ check-peertube (pull_request) Successful in 22s
/ check-panel (pull_request) Failing after 2s
/ check-deployment-basic (pull_request) Failing after 3s
/ check-deployment-cli (pull_request) Failing after 5s
/ check-deployment-panel (pull_request) Failing after 2s
to ba2cb8fa40
All checks were successful
/ check-pre-commit (pull_request) Successful in 19s
/ check-data-model (pull_request) Successful in 40s
/ check-peertube (pull_request) Successful in 24s
/ check-panel (pull_request) Successful in 1m36s
/ check-deployment-basic (pull_request) Successful in 43s
/ check-deployment-cli (pull_request) Successful in 57s
/ check-deployment-panel (pull_request) Successful in 1m58s
2025-07-11 16:05:58 +02:00
Compare
kiara scheduled this pull request to auto merge when all checks succeed 2025-07-11 16:06:55 +02:00
kiara merged commit aef414ffe8 into main 2025-07-11 16:09:29 +02:00
kiara deleted branch resolve-qemu-regressions 2025-07-11 16:09:30 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
fediversity/fediversity!432
No description provided.