{ description = "Steam ROM Manager Home Manager Module"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # home-manager is declared so consumers can do # inputs.home-manager.follows = "steam-rom-manager/home-manager" # and so nix flake check can instantiate the module correctly. home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, home-manager, }: let # Linux systems where Steam (and AppImages) are supported. # Darwin is intentionally excluded: the SRM AppImage is Linux-only. linuxSystems = [ "x86_64-linux" "aarch64-linux" ]; forLinux = nixpkgs.lib.genAttrs linuxSystems; in { # Home Manager module — available under both the conventional .default # key and an explicit name for clarity in consumer flakes. homeManagerModules.default = import ./modules/steam-rom-manager; homeManagerModules.steam-rom-manager = import ./modules/steam-rom-manager; # `nix flake check` target: instantiate the module with a minimal config # to catch evaluation errors before they reach users. checks = forLinux ( system: let pkgs = nixpkgs.legacyPackages.${system}; hmLib = home-manager.lib; in { module-eval = (hmLib.homeManagerConfiguration { inherit pkgs; modules = [ self.homeManagerModules.default { home = { username = "test"; homeDirectory = "/home/test"; stateVersion = "24.11"; }; programs.steam-rom-manager = { enable = true; steamUsername = "testuser"; emulators = { # ROM parsers retroarch.enable = true; # cross-platform mgba.enable = true; # cross-platform # Platform parsers (no package) epic.enable = true; "itch.io".enable = true; # Disabled flag flycast = { enable = true; disabled = true; }; }; }; } ]; }).activationPackage; } ); }; }