Flake input assertions fail only inside specialisation

Here is the problematic file in my config, if I uncomment the code to make the vgpu config into a specialisation:

    #specialisation."vgpu".configuration = {
    #  environment.etc.specialisation.text = "vgpu";
    #    ...
    #  };

it fails with

error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'nixos-system-hyrulecastle-25.05.20250804.ce01dae'
         whose name attribute is located at /nix/store/5jrv34dcsm9zjl666ann69sw5k4rv30w-source/pkgs/stdenv/generic/make-derivation.nix:480:13

       … while evaluating attribute 'buildCommand' of derivation 'nixos-system-hyrulecastle-25.05.20250804.ce01dae'
         at /nix/store/5jrv34dcsm9zjl666ann69sw5k4rv30w-source/nixos/modules/system/activation/top-level.nix:68:7:
           67|       passAsFile = [ "extraDependencies" ];
           68|       buildCommand = systemBuilder;
             |       ^
           69|

       … while evaluating the option `system.systemBuilderCommands':

       … while evaluating definitions from `/nix/store/5jrv34dcsm9zjl666ann69sw5k4rv30w-source/nixos/modules/system/activation/specialisation.nix':

       … while evaluating the option `specialisation.vgpu.configuration.system.build.toplevel':

       … while evaluating definitions from `/nix/store/5jrv34dcsm9zjl666ann69sw5k4rv30w-source/nixos/modules/system/activation/top-level.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error:
       Failed assertions:
       - vGPU-Unlock-patcher is not supported for vGPU version 550.90.05

If I use a vgpu4nixos input fork without assertion, it also fails, so it’s probably not an assertions problem. It might have to do with vgpu4nixos overriding nvidia kernel modules:

# in utils.nix
overlayNvidiaPackages =
  args:
  (self: super: {
    linuxKernel = super.linuxKernel // {
      packagesFor =
        kernel:
        (super.linuxKernel.packagesFor kernel).extend (
          _: super': {
            nvidiaPackages = super'.nvidiaPackages.extend (_: _: args);
          }
        );
    };
  });

But I’m at a lost

The solution was apparantly just

# thanks to https://github.com/MakiseKurisu/nixos-config/blob/main/modules/nvidia-vgpu.nix
{
  config,
  pkgs,
  lib,
  inputs,
  ...
}:

let
  cfg = config.mySystemHyruleCastle.vgpu; # TODO make it a specialization
in
{
  imports = [
    #inputs.nixos-nvidia-vgpu.nixosModules.nvidia-vgpu

  ];
  
  options.mySystemHyruleCastle.vgpu = {
    enable = lib.mkEnableOption "NvidiaVgpuSharing";
  };

  config = lib.mkIf cfg.enable {
    specialisation."vgpu".configuration = { config, pkgs, lib, ... }: {
        imports = [
          inputs.vgpu4nixos.nixosModules.host
          inputs.fastapi-dls-nixos.nixosModules.default
        ];
      environment.etc.specialisation.text = "vgpu";
      system.nixos.tags = [ "vgpu" ];

    boot = {
      kernelPackages = pkgs.linuxPackages_6_6;
    };

    # https://docs.nvidia.com/vgpu/latest/pdf/grid-vgpu-user-guide.pdf
    hardware = {
      nvidia = {
        package = config.boot.kernelPackages.nvidiaPackages.vgpu_17_3;
        open = lib.mkForce false;
        vgpu = {
          patcher = {
            enable = true;
            options.doNotForceGPLLicense = true;
            # runtimeOptions.enable = true;
            copyVGPUProfiles = {
              "1E93:0000" = "1E30:12BA"; # GeForce RTX 2080 SUPER Mobile / Max-Q
              "1E07:0000" = "1E30:12BA"; # GeForce RTX 2080 Ti Rev. A
            };
            profileOverrides = {
              # GRID RTX6000-1Q
              "256" = {
                vramAllocation = 1024;
                heads = 4;
                enableCuda = true;
                display = {
                  width = 7680;
                  height = 4320;
                };
                framerateLimit = 0;
              };
              # GRID RTX6000-6Q
              "260" = {
                vramAllocation = 6144;
                heads = 4;
                enableCuda = true;
                display = {
                  width = 7680;
                  height = 4320;
                };
                framerateLimit = 0;
              };
              # GRID RTX6000-24Q
              "263" = {
                vramAllocation = 16384;
                heads = 4;
                enableCuda = true;
                display = {
                  width = 7680;
                  height = 4320;
                };
                framerateLimit = 0;
              };
            };
          };
          driverSource = {
            name = "NVIDIA-Linux-x86_64-550.90.05-vgpu-kvm.run";
            # url get from https://drive.google.com/file/d/1FOD_q0ZA04i9IqaoFEB8I7wcVkPBkkqT/view?usp=sharing
            sha256 = "sha256-vBsxP1/SlXLQEXx70j/g8Vg/d6rGLaTyxsQQ19+1yp0=";
          };
        };
      };
    };

    programs.mdevctl = {
      enable = true;
    };
    };
  };
}