{
  hostname,
  inputs,
  system ? "x86_64-linux",
  users ? [ ],
  modules ? [ ],
  homeModules ? [ ],
  overlays ? [ ],
}:
let
  mkUsers = import ./mkUsers.nix;
in
inputs.nixpkgs.lib.nixosSystem {
  inherit system;
  modules = [
    {
      _module.args = {
        inherit inputs;
        inherit hostname;
        inherit system;
      }
      // inputs;
      nixpkgs.overlays = overlays;
    }
    inputs.sops-nix.nixosModules.sops
    inputs.home-manager.nixosModules.home-manager
    {
      home-manager = {
        useGlobalPkgs = true;
        sharedModules = [ inputs.sops-nix.homeManagerModules.sops ] ++ homeModules;
        extraSpecialArgs = {
          inherit inputs;
          inherit hostname;
        };
      };
    }
    ../hosts/${hostname}
    ../hosts/common
    (mkUsers {
      inherit hostname;
      inherit users;
    })
  ]
  ++ modules;
}
