{
  config,
  lib,
  pkgs,
  ...
}:

{
  imports = [ ];

  options.me = {
    jujutsu.enable = lib.mkOption {
      type = lib.types.bool;
      default = false;
      example = true;
      description = "Whether we want to install jujutsu.";
    };

    jujutsu.config = lib.mkOption {
      type = lib.types.nullOr lib.types.path;
      default = null;
      example = ./files/jujutsu_config_home.toml;
      description = "A jujutsu config file.";
    };
  };

  config = lib.mkIf config.me.jujutsu.enable (
    lib.mkMerge [
      {
        environment.systemPackages = with pkgs; [
          jujutsu
        ];
      }
      (lib.mkIf (config.me.jujutsu.config != null) {
        me.install.user.talexander.file = {
          ".config/jj/config.toml" = {
            source = config.me.jujutsu.config;
          };
        };
      })
    ]
  );
}
