From ad8fc76af1a36971cae5dae1990e9b170920f40f Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Wed, 13 Nov 2024 17:22:55 +0100 Subject: [PATCH] jujutsu: init module --- home-manager/modules/jujutsu/default.nix | 84 ++++++++++++++++++++++++ users/erwin/work.nix | 7 ++ 2 files changed, 91 insertions(+) create mode 100644 home-manager/modules/jujutsu/default.nix diff --git a/home-manager/modules/jujutsu/default.nix b/home-manager/modules/jujutsu/default.nix new file mode 100644 index 0000000..8035ca1 --- /dev/null +++ b/home-manager/modules/jujutsu/default.nix @@ -0,0 +1,84 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +let + cfg = config.eboskma.programs.jujutsu; +in +{ + options.eboskma.programs.jujutsu = { + enable = mkEnableOption "jujutsu"; + name = mkOption { + description = "your name"; + type = types.nonEmptyStr; + }; + + email = mkOption { + description = "your e-mail address"; + type = types.nonEmptyStr; + }; + + signingKey = mkOption { + description = "your signing key"; + type = types.nullOr types.str; + default = null; + }; + + signingBackend = mkOption { + description = "the type of signing key"; + type = types.enum [ + "gpg" + "ssh" + ]; + default = "openpgp"; + }; + }; + + config = mkIf cfg.enable { + programs.jujutsu = { + enable = true; + settings = { + user = { + name = cfg.name; + email = cfg.email; + }; + + core = { + fsmonitor = "watchman"; + watchman.register_snapshot_triggers = true; + }; + + ui = { + diff = { + tool = "difftastic"; + }; + pager = lib.getExe pkgs.bat; + }; + + diff.difftastic = { + program = lib.getExe pkgs.difftastic; + diff-args = [ + "--color=auto" + "--background=dark" + "--display=side-by-side-show-both" + "$left" + "$right" + ]; + + }; + + signing = { + sign-all = true; + backend = cfg.signingBackend; + key = cfg.signingKey; + }; + + }; + }; + + home.packages = with pkgs; [ watchman ]; + }; +} diff --git a/users/erwin/work.nix b/users/erwin/work.nix index 560b6cb..30da90b 100644 --- a/users/erwin/work.nix +++ b/users/erwin/work.nix @@ -93,6 +93,13 @@ in } ]; }; + jujutsu = { + enable = true; + name = "Erwin Boskma"; + email = "erwin@horus.nu"; + signingKey = "~/.ssh/id_ed25519_sk_horus.pub"; + signingBackend = "ssh"; + }; mpd.enable = true; neovim.enable = true; nushell.enable = true;