Problems setting up suyu emulator

I’ve used this flake setup to add suyu to my home Manager configuration, but I keep getting an error I don’t understand:

flake.nix:

{
  description = "My NixOS Flake";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
    chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
    home-manager = {
      url = "github:nix-community/home-manager/release-24.11";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixos-hardware.url = "github:NixOS/nixos-hardware/master";
    nix-gaming.url = "github:fufexan/nix-gaming";
    suyu = {
      url = "git+https://git.suyu.dev/suyu/nix-flake";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs, chaotic, home-manager, nixos-hardware, nix-gaming, suyu, ... }@inputs: {
    nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      specialArgs = { inherit inputs; };
      modules = [
        ./configuration.nix
        nixos-hardware.nixosModules.asus-zephyrus-ga402x-amdgpu
        chaotic.nixosModules.default
        nix-gaming.nixosModules.platformOptimizations
      ];
    };

    homeConfigurations.user = home-manager.lib.homeManagerConfiguration {
      pkgs = nixpkgs.legacyPackages.x86_64-linux;
      extraSpecialArgs = { inherit inputs; };
      modules = [
        ./home.nix
        chaotic.homeManagerModules.default
        suyu.packages.x86_64-linux.suyu
      ];
    };
  };
}

when I update home manager, I get this error:

 home-manager switch --flake .
error:
       … while evaluating a branch condition
         at /nix/store/ilqr95vggnjqpbh6r0fiz2dw43iljg93-source/lib/lists.nix:142:18:
          141|       len = length list;
          142|       fold' = n: if n == len then nul else op (elemAt list n) (fold' (n + 1));
             |                  ^
          143|     in

       … while calling the 'length' builtin
         at /nix/store/ilqr95vggnjqpbh6r0fiz2dw43iljg93-source/lib/lists.nix:141:13:
          140|     let
          141|       len = length list;
             |             ^
          142|       fold' = n: if n == len then nul else op (elemAt list n) (fold' (n + 1));

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

       error: The option `NIX_CFLAGS_COMPILE' does not exist. Definition values:
       - In `<unknown-file>': "-msse4.1"

as far as changes I made to my home manager, it was just adding pkgs.suyu to it:

{ config, pkgs, ... }:

{

  home.username = "user";
  home.homeDirectory = "/home/user";
  home.stateVersion = "25.05"; # Please read the comment before changing.
  nixpkgs.config.allowUnfree = true;
  nixpkgs.config.allowBroken = true;

  nixpkgs.config.permittedInsecurePackages = [
     #"electron-27.3.11" # I think teams or goofcord idk
     "olm-3.2.16" #for neochat
  ];

  nix.package = pkgs.nix;

  home.packages = [
    pkgs.suyu
  ];

can anyone tell me what to do?

errors because a package is not a module, so remove this.

That won’t work without an overlay, you need to use inputs.suyu.packages.x86_64-linux.suyu

Thank, this helped, I updated my flake.nix to this:

{
  description = "My NixOS Flake";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
    chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
    home-manager = {
      url = "github:nix-community/home-manager/release-24.11";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixos-hardware.url = "github:NixOS/nixos-hardware/master";
    nix-gaming.url = "github:fufexan/nix-gaming";
    suyu = {
      url = "git+https://git.suyu.dev/suyu/nix-flake";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs, chaotic, home-manager, nixos-hardware, nix-gaming, suyu, ... }@inputs:
  let
    system = "x86_64-linux";

    # Define overlays
    overlays = [
      (final: prev: {
        suyu = suyu.packages.${system}.suyu;
      })
    ];

    pkgs = import nixpkgs {
      inherit system overlays;
      config.allowUnfree = true;
    };
  in {
    nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
      inherit system;
      specialArgs = { inherit inputs; };
      modules = [
        ./configuration.nix
        nixos-hardware.nixosModules.asus-zephyrus-ga402x-amdgpu
        chaotic.nixosModules.default
        nix-gaming.nixosModules.platformOptimizations
      ];
    };

    homeConfigurations.user = home-manager.lib.homeManagerConfiguration {
      inherit pkgs;
      extraSpecialArgs = { inherit inputs; };
      modules = [
        ./home.nix
        chaotic.homeManagerModules.default
      ];
    };
  };
}

there’s probably better/shorter ways to do it but I don’t know.
this got me to start building suyu when doing home-manager switch --flake . but it has some dependency erros now that I’m not sure about:

 home-manager switch --flake . --show-trace
error: builder for '/nix/store/c9142lj33v46vfnvdxnwx82lx7by4dig-suyu-0.0.3.drv' failed with exit code 2;
       last 25 log lines:
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_scheduler.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_shader_util.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_staging_buffer_pool.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_state_tracker.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_swapchain.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_texture_cache.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_texture_cache_base.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_turbo_mode.cpp.o
       > In file included from /build/suyu/src/./video_core/vulkan_common/vk_enum_string_helper.h:8,
       >                  from /build/suyu/src/video_core/renderer_vulkan/vk_swapchain.cpp:15:
       > /build/suyu/externals/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h: In function 'const char* string_VkDriverId(VkDriverId)':
       > /build/suyu/externals/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:3481:14: error: 'VK_DRIVER_ID_MESA_AGXV' was not declared in this scope; did you mean 'VK_DRIVER_ID_MESA_V3DV'?
       >  3481 |         case VK_DRIVER_ID_MESA_AGXV:
       >       |              ^~~~~~~~~~~~~~~~~~~~~~
       >       |              VK_DRIVER_ID_MESA_V3DV
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_update_descriptor.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/shader_cache.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/shader_environment.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/shader_notify.cpp.o
       > [ 52%] Building CXX object src/video_core/CMakeFiles/video_core.dir/surface.cpp.o
       > [ 53%] Building CXX object src/video_core/CMakeFiles/video_core.dir/texture_cache/accelerated_swizzle.cpp.o
       > make[2]: *** [src/video_core/CMakeFiles/video_core.dir/build.make:1661: src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_swapchain.cpp.o] Error 1
       > make[2]: *** Waiting for unfinished jobs....
       > make[1]: *** [CMakeFiles/Makefile2:1420: src/video_core/CMakeFiles/video_core.dir/all] Error 2
       > make: *** [Makefile:136: all] Error 2
       For full logs, run 'nix log /nix/store/c9142lj33v46vfnvdxnwx82lx7by4dig-suyu-0.0.3.drv'.
error: 1 dependencies of derivation '/nix/store/z6rqqshc7rlyn80fgy6zg03clfmywgcn-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/5flzad6y4300vk1zdrp3vkmgdqhiippd-man-paths.drv' failed to build
error: 1 dependencies of derivation '/nix/store/007v8p4cj1q4k94xfi9b0qs5ivyx6cl4-suyu-0.0.3-fish-completions.drv' failed to build
error: 1 dependencies of derivation '/nix/store/a45aw9kkgksrc2hy4mg2w97pbdn467c4-home-manager-generation.drv' failed to build

Yeah suyu not building is a whole other thing, it hasn’t been updated in 7 months so that’s not surprising. You’ll have to go full-on c++ developer mode to fix that, probably a missing header or maybe the vulkan API’s changed since then, no idea offhand.