{ config, lib, pkgs, inputs, ... }@args:

let cfg = config.sydnix.users.msyds.emacs;
in {
  options.sydnix.users.msyds.emacs = {
    enable = lib.mkEnableOption ''Emacs, à la msyds'';
    userDir = lib.mkOption {
      description = ''
        The path to the Emacs user directory.
      '';
      default = "/persist/dots/modules/home/users/msyds/emacs";
      type = lib.types.path;
    };
    package = lib.mkPackageOption pkgs "emacs" {
      default = [ "emacs-pgtk" ];
    };
  };

  config = lib.mkIf cfg.enable {
    sydnix.emacs = {
      enable = true;
      inherit (cfg) userDir;
      fontPackages = [
        pkgs.julia-mono
        pkgs.nerd-fonts.victor-mono
        pkgs.ibm-plex
      ];
    };
  };
}
