The v0.36 release stopped honoring `$PAGER`. So enforce it in the configuration (as I don't like their default pager settings). Ideally this would be `mkIf`ed behind `my.home.pager.enable`, however it looks like this does not work with the TOML type (does not seem to do any `mkMerge`-ish logic).
74 lines
1.7 KiB
Nix
74 lines
1.7 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
cfg = config.my.home.jujutsu;
|
|
|
|
inherit (lib.my) mkMailAddress;
|
|
in
|
|
{
|
|
options.my.home.jujutsu = with lib; {
|
|
enable = my.mkDisableOption "jujutsu configuration";
|
|
|
|
package = mkPackageOption pkgs "jujutsu" { };
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
assertions = [
|
|
{
|
|
# For `jj git` commands
|
|
assertion = cfg.enable -> config.my.home.git.enable;
|
|
message = ''
|
|
`config.my.home.jujutsu` relies on `config.my.home.git` being enabled.
|
|
'';
|
|
}
|
|
];
|
|
|
|
programs.jujutsu = {
|
|
enable = true;
|
|
|
|
inherit (cfg) package;
|
|
|
|
settings = {
|
|
# Who am I?
|
|
user = {
|
|
name = "Bruno BELANYI";
|
|
email = mkMailAddress "bruno" "belanyi.fr";
|
|
};
|
|
|
|
aliases = {
|
|
jj = [ "util" "exec" "--" "jj" ];
|
|
lol = [ "log" "-r" "..@" "-T" "builtin_log_oneline" ];
|
|
lola = [ "lol" "-r" "all()" ];
|
|
};
|
|
|
|
ui = {
|
|
# I don't like word-diff
|
|
diff-formatter = ":git";
|
|
# Does not honor `$PAGER` (anymore)
|
|
pager = lib.mkDefault config.home.sessionVariables.PAGER;
|
|
};
|
|
|
|
"--scope" = [
|
|
# Multiple identities
|
|
{
|
|
"--when" = {
|
|
repositories = [ "~/git/EPITA/" ];
|
|
};
|
|
user = {
|
|
name = "Bruno BELANYI";
|
|
email = mkMailAddress "bruno.belanyi" "epita.fr";
|
|
};
|
|
}
|
|
{
|
|
"--when" = {
|
|
repositories = [ "~/git/work/" ];
|
|
};
|
|
user = {
|
|
name = "Bruno BELANYI";
|
|
email = mkMailAddress "ambroisie" "google.com";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|