Flake for my NixOS devices
at main 69 lines 1.4 kB view raw
1{...}: { 2 pkgs, 3 config, 4 lib, 5 ... 6}: { 7 options.cow.jj = { 8 enable = lib.mkEnableOption "jj + customizations"; 9 }; 10 11 config = let 12 conf = config.cow.jj; 13 in (lib.mkIf conf.enable { 14 programs.jujutsu = { 15 enable = true; 16 settings = { 17 ui = { 18 default-command = [ 19 "log" 20 "--reversed" 21 "-n" 22 "15" 23 ]; 24 pager = "less -FR"; 25 editor = lib.mkIf config.cow.neovim.enable "nvim"; 26 diff-editor = ":builtin"; 27 merge-editor = "mergiraf"; 28 }; 29 git = { 30 private-commits = "description('private:*')"; 31 }; 32 33 template-aliases = { 34 "format_short_id(id)" = "id.shortest()"; 35 "format_timestamp(timestamp)" = "timestamp.ago()"; 36 }; 37 aliases = { 38 "push" = [ 39 "git" 40 "push" 41 ]; 42 "pull" = [ 43 "git" 44 "fetch" 45 ]; 46 "bsm" = [ 47 "bookmark" 48 "set" 49 "main" 50 ]; 51 "bm" = ["bookmark"]; 52 "d" = [ 53 "describe" 54 "-m" 55 ]; 56 "s" = ["show -s"]; 57 "ss" = ["show"]; 58 "n" = ["new"]; 59 "ed" = ["edit"]; 60 }; 61 }; 62 }; 63 64 home.packages = with pkgs; [ 65 less 66 mergiraf 67 ]; 68 }); 69}