yep, more dotfiles
1{ config 2, lib 3, pkgs 4, lpkgs 5, ... 6}: 7 8let 9 flags = config.local.flags; 10 11 keys = import ../../secrets/keys.nix; 12 13 cfg = config.local.fragment.jujutsu; 14in 15{ 16 options.local.fragment.jujutsu.enable = lib.mkEnableOption '' 17 Jujutsu related 18 ''; 19 20 config = lib.mkIf cfg.enable { 21 programs.jujutsu = { 22 enable = true; 23 package = if flags.onlyCached then pkgs.jujutsu else lpkgs.jujutsu; 24 25 settings = { 26 user = { 27 name = "Milo Moisson"; 28 email = "milo@wiro.world"; 29 }; 30 31 signing = { 32 behavior = "own"; 33 backend = "ssh"; 34 key = keys.milomoisson; 35 36 git.sign-on-push = true; 37 }; 38 39 template-aliases = { 40 custom_log_compact = '' 41 if(root, 42 format_root_commit(self), 43 label(if(current_working_copy, "working_copy"), 44 concat( 45 separate(" ", 46 format_short_change_id_with_hidden_and_divergent_info(self), 47 format_short_signature_oneline(author), 48 bookmarks, 49 tags, 50 working_copies, 51 if(conflict, label("conflict", "conflict")), 52 if(config("ui.show-cryptographic-signatures").as_boolean(), 53 format_short_cryptographic_signature(signature)), 54 if(empty, label("empty", "(empty)")), 55 if(description, 56 description.first_line(), 57 label(if(empty, "empty"), description_placeholder), 58 ), 59 ) ++ "\n", 60 ), 61 ) 62 ) 63 ''; 64 }; 65 66 templates = { 67 log = "custom_log_compact"; 68 }; 69 70 ui = { 71 default-command = "log"; 72 73 diff-editor = ":builtin"; 74 merge-editor = ":builtin"; 75 pager = ":builtin"; 76 77 diff-formatter = [ "difft" "--color=always" "--display=inline" "$left" "$right" ]; 78 }; 79 80 aliases = { 81 ui = [ "util" "exec" "--" "lazyjj" ]; 82 }; 83 84 git = { 85 private-commits = ''description(glob:"private:*")''; 86 }; 87 }; 88 }; 89 90 home.packages = with pkgs; [ 91 difftastic 92 ]; 93 }; 94}