This commit is contained in:
mjallen18
2026-03-15 19:30:48 -05:00
parent d303a48a30
commit 2fbb4d1f1b
4 changed files with 842 additions and 536 deletions

View File

@@ -3,19 +3,66 @@
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, ... }:
outputs =
{
self,
nixpkgs,
home-manager,
}:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# 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";
# retroarch is cross-platform; use it as the check target
emulators.retroarch.enable = true;
};
}
];
}).activationPackage;
}
);
};
}
}