{
  isHM ? null,
  lib,
  ...
}: {
  assertions = [
    {
      assertion = isHM != null;
      message = "The \"home-manager\" flag isHM is required.";
    }
  ];
  imports =
    [
      # modules containing both system and home-manager configs
      ./bin/nix-scripts.nix
    ]
    ++ lib.optionals (! isHM) [
      # pure system modules
      ./desktop/de
      ./desktop/dm
      ./desktop/themes
      ./hardware/bluetooth.nix
      ./hardware/sound.nix
      ./hardware/yubikey.nix
      ./networking/wireguard
      ./programs/creative.nix
      ./programs/games.nix
      ./programs/spotify-shortcuts.nix
      ./services/borg-server.nix
      ./services/gitea-instance.nix
      ./services/gotify-instance.nix
      ./services/kdeconnect.nix
      ./services/nextcloud-instance.nix
      ./services/virt-manager.nix
    ]
    ++ lib.optionals isHM [
      # pure home-manager modules
      ./home/doom
      ./home/firefox.nix
      ./home/flameshot.nix
      ./home/gotify.nix
      ./home/hyprland
      ./home/jj.nix
      ./home/kdeconnect.nix
      ./home/kitty
      ./home/nextcloud
      ./home/plasma.nix
      ./home/ranger
      ./home/ssh.nix
      ./home/swaync
      ./home/themes/layan.nix
      ./home/waybar
      ./home/wlogout
      ./home/wofi
      ./home/yubikey.nix
      ./home/zsh
    ];
}
