{ self, prefs, ... }:

let
  inherit (self) inputs;

  lib = inputs.nixpkgs.lib;
  hmProfiles = self + /profiles;

  mkSystem =
    {
      system,
      hostname,
      useHomeManager ? true,
      modules ? [ ],
    }:
    lib.nixosSystem {
      specialArgs = { inherit inputs prefs; };
      modules = modules
        ++ lib.lists.optionals useHomeManager [ inputs.home-manager.nixosModules.default ]
        ++ [
          ./base-configuration.nix
          ./${hostname}
          hmProfiles
        ];
    };
in
{
  hulk = mkSystem {
    system = "x86_64-linux";
    hostname = "hulk";
  };
}
