From aef414ffe84441ab4bc9f513a7e60ed0d7f8588f Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Fri, 11 Jul 2025 16:09:27 +0200 Subject: [PATCH] resolve regressions from recent qemu files (#432) - move import to match module classes - manually import sources to resolve infinite recursion closes #431. Reviewed-on: https://git.fediversity.eu/Fediversity/Fediversity/pulls/432 Co-authored-by: Kiara Grouwstra Co-committed-by: Kiara Grouwstra --- infra/common/proxmox-qemu-vm.nix | 18 +++++++++++++++--- infra/flake-part.nix | 5 ++++- machines/dev/forgejo-ci/default.nix | 4 ++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/infra/common/proxmox-qemu-vm.nix b/infra/common/proxmox-qemu-vm.nix index b100a6d5..961bb963 100644 --- a/infra/common/proxmox-qemu-vm.nix +++ b/infra/common/proxmox-qemu-vm.nix @@ -1,9 +1,21 @@ -{ modulesPath, ... }: - +let + # pulling this in manually over from module args resolves an infinite recursion. + # FIXME: instead untangle `//infra/flake-part.nix` and make it stop passing wild functions. + # move moving towards a portable-services-like pattern where some things are submodules. + # Right now those wild functions are for parameterising a bunch of things, + # and the modular way to do that would be options -- + # obviously you can't use those for `imports`, + # so one way to decouple fixpoints is to isolate them into submodules. + # Therefore one approach would be to try to go down the call graph, + # and see where what's currently a function could be a `submodule` field of something else. + sources = import ../../npins; +in { _class = "nixos"; - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + imports = [ + "${sources.nixpkgs}/nixos/modules/profiles/qemu-guest.nix" + ]; boot = { initrd = { diff --git a/infra/flake-part.nix b/infra/flake-part.nix index 9d2b246a..4ad559bc 100644 --- a/infra/flake-part.nix +++ b/infra/flake-part.nix @@ -33,6 +33,10 @@ let ; }; + nixos.module.imports = [ + ./common/proxmox-qemu-vm.nix + ]; + imports = [ ./common/resource.nix @@ -40,7 +44,6 @@ let ++ ( if isTestVm then [ - ./common/proxmox-qemu-vm.nix ../machines/operator/${vmName} { nixos.module.users.users.root.openssh.authorizedKeys.keys = [ diff --git a/machines/dev/forgejo-ci/default.nix b/machines/dev/forgejo-ci/default.nix index f0aa9c45..901f11c0 100644 --- a/machines/dev/forgejo-ci/default.nix +++ b/machines/dev/forgejo-ci/default.nix @@ -48,7 +48,7 @@ in }; ## NOTE: This is a physical machine, so is not covered by disko - fileSystems."/" = { + fileSystems."/" = lib.mkForce { device = "rpool/root"; fsType = "zfs"; }; @@ -58,7 +58,7 @@ in fsType = "zfs"; }; - fileSystems."/boot" = { + fileSystems."/boot" = lib.mkForce { device = "/dev/disk/by-uuid/50B2-DD3F"; fsType = "vfat"; options = [