fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . programs . gitui ; 8 9in { 10meta . maintainers = [ hm . maintainers . mifom ]; 11 12options . programs . gitui = { 13enable = 14mkEnableOption "gitui, blazing fast terminal-ui for git written in rust" ; 15 16package = mkOption { 17type = types . package ; 18default = pkgs . gitui ; 19defaultText = "pkgs.gitui" ; 20description = "The package to use." ; 21}; 22 23keyConfig = mkOption { 24type = types . either types . path types . lines ; 25default = "" ; 26example = '' 27exit: Some(( code: Char('c'), modifiers: ( bits: 2,),)), 28quit: Some(( code: Char('q'), modifiers: ( bits: 0,),)), 29exit_popup: Some(( code: Esc, modifiers: ( bits: 0,),)), 30'' ; 31description = '' 32Key config in Ron file format. This is written to 33{file}`$XDG_CONFIG_HOME/gitui/key_config.ron`. 34'' ; 35}; 36 37theme = mkOption { 38type = types . either types . path types . lines ; 39default = '' 40( 41selected_tab: Reset, 42command_fg: White, 43selection_bg: Blue, 44selection_fg: White, 45cmdbar_bg: Blue, 46cmdbar_extra_lines_bg: Blue, 47disabled_fg: DarkGray, 48diff_line_add: Green, 49diff_line_delete: Red, 50diff_file_added: LightGreen, 51diff_file_removed: LightRed, 52diff_file_moved: LightMagenta, 53diff_file_modified: Yellow, 54commit_hash: Magenta, 55commit_time: LightCyan, 56commit_author: Green, 57danger_fg: Red, 58push_gauge_bg: Blue, 59push_gauge_fg: Reset, 60tag_fg: LightMagenta, 61branch_fg: LightYellow, 62) 63'' ; 64description = '' 65Theme in Ron file format. This is written to 66{file}`$XDG_CONFIG_HOME/gitui/theme.ron`. 67'' ; 68}; 69}; 70 71config = mkIf cfg . enable { 72home . packages = [ cfg . package ]; 73 74xdg . configFile . "gitui/theme.ron" . source = 75if builtins . isPath cfg . theme || lib . isStorePath cfg . theme then 76cfg . theme 77else 78pkgs . writeText "gitui-theme.ron" cfg . theme ; 79 80xdg . configFile . "gitui/key_bindings.ron" . source = 81if builtins . isPath cfg . keyConfig || lib . isStorePath cfg . keyConfig then 82cfg . keyConfig 83else 84pkgs . writeText "gitui-key-config.ron" cfg . keyConfig ; 85}; 86}