resolve regressions from recent qemu files (#432)

- move import to match module classes
- manually import sources to resolve infinite recursion

closes #431.

Reviewed-on: Fediversity/Fediversity#432
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
Kiara Grouwstra 2025-07-11 16:09:27 +02:00 committed by kiara Grouwstra
parent 6d74112518
commit aef414ffe8
3 changed files with 21 additions and 6 deletions

View file

@ -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 = {

View file

@ -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 = [

View file

@ -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 = [