Переглянути джерело

refactor: remove a lot of cli configuration

Zander Hawke 10 місяців тому
батько
коміт
e53672305f

+ 0 - 13
home/features/cli/aider-chat.nix

@@ -1,13 +0,0 @@
-{ pkgs, ... }: {
-  home.packages = with pkgs; [
-    aider-chat
-  ];
-
-  home.sessionVariables = {
-    OPENROUTER_API_KEY = "";
-  };
-
-  # programs.fish.interactiveShellInit = ''
-  #   set OPENROUTER_API_KEY $(pass openrouter.ai/avante)
-  # '';
-}

+ 1 - 41
home/features/cli/bat.nix

@@ -1,50 +1,10 @@
 { pkgs, ... }:
-let
-  catppuccin-src = pkgs.fetchFromGitHub {
-    owner = "catppuccin";
-    repo = "bat";
-    rev = "699f60f";
-    sha256 = "sha256-6fWoCH90IGumAMc4buLRWL0N61op+AuMNN9CAR9/OdI=";
-  };
-in
 {
   programs.bat = {
     enable = true;
-    config = {
-      theme = "catppuccin-frappe";
-    };
+    config.theme = "kanagawa";
 
     themes = {
-      catppuccin-latte = {
-        src = catppuccin-src;
-        file = "/themes/Catppuccin Latte.tmTheme";
-      };
-
-      catppuccin-frappe = {
-        src = catppuccin-src;
-        file = "/themes/Catppuccin Frappe.tmTheme";
-      };
-
-      catppuccin-macchiato = {
-        src = catppuccin-src;
-        file = "/themes/Catppuccin Macchiato.tmTheme";
-      };
-
-      catppuccin-mocha = {
-        src = catppuccin-src;
-        file = "/themes/Catppuccin Mocha.tmTheme";
-      };
-
-      nord = {
-        src = pkgs.fetchFromGitHub {
-          owner = "crabique";
-          repo = "Nord-plist";
-          rev = "0d655b23d6b300e691676d9b90a68d92b267f7ec";
-          sha256 = "sha256-YUogcLO+W1hD0X/nsworGS1SHsOolp/g9N0rQJ/Q5wc=";
-        };
-        file = "/Nord.tmTheme";
-      };
-
       kanagawa = {
         src = pkgs.fetchFromGitHub {
           owner = "rebelot";

+ 5 - 7
home/features/cli/default.nix

@@ -1,21 +1,19 @@
+{ pkgs, ... }:
 {
   imports = [
-    ./aider-chat.nix
     ./bat.nix
-    ./direnv.nix
     ./fish.nix
-    ./fzf.nix
     ./git.nix
     ./gnupg.nix
-    ./nostr.nix
-    ./pass.nix
     ./ssh.nix
     ./starship.nix
     ./tmux.nix
-    ./yazi.nix
-    ./zoxide.nix
   ];
 
+  home.packages = [ pkgs.unstable.nak ];
+
   programs.bash.enable = true;
+  programs.direnv.enable = true;
+  programs.zoxide.enable = true;
   programs.zsh.enable = true;
 }

+ 0 - 3
home/features/cli/direnv.nix

@@ -1,3 +0,0 @@
-{
-  programs.direnv.enable = true;
-}

+ 11 - 19
home/features/cli/fish.nix

@@ -1,21 +1,13 @@
-{ lib
-, pkgs
-, ...
-}: {
-  programs.fish = {
-    enable = true;
+{ lib, pkgs, ... }:
+{
+  programs.fish.enable = true;
 
-    interactiveShellInit = lib.mkAfter ''
-      fish_config theme choose "Catppuccin Frappe"
-    '';
-  };
-
-  xdg.configFile."fish/themes/Catppuccin Frappe.theme".text = lib.strings.fileContents (pkgs.fetchFromGitHub
-    {
-      owner = "catppuccin";
-      repo = "fish";
-      rev = "cc8e4d8";
-      sha256 = "sha256-udiU2TOh0lYL7K7ylbt+BGlSDgCjMpy75vQ98C1kFcc=";
-    }
-  + "/themes/Catppuccin Frappe.theme");
+  xdg.configFile."fish/conf.d/kanagawa.fish".text =
+    lib.strings.fileContents (pkgs.fetchFromGitHub
+      {
+        owner = "rebelot";
+        repo = "kanagawa.nvim";
+        rev = "83e377c";
+        sha256 = "sha256-IBZFfQRNvIEIFiQF5Gm4LGTmRc2VCWy4Gx51RhtDNDM=";
+      } + "/extras/fish/kanagawa.fish");
 }

+ 0 - 21
home/features/cli/fzf.nix

@@ -1,21 +0,0 @@
-{ pkgs, ... }: {
-  home.packages = with pkgs; [ fd ];
-
-  programs.fzf = rec {
-    # TODO(@tstachl): figure out why this is happening in tmux
-    # fish: Unknown command: fzf_key_bindings
-    # source /nix/store/.../share/fzf/key-bindings.fish && fzf_key_bindings
-    enable = false;
-    changeDirWidgetCommand = defaultCommand;
-    changeDirWidgetOptions = [ "--type=d" ] ++ defaultOptions;
-    defaultCommand = "${pkgs.fd}/bin/fd";
-    defaultOptions = [
-      "--strip-cwd-prefix"
-      "--hidden"
-      "--exclude .git"
-    ];
-    fileWidgetCommand = defaultCommand;
-    fileWidgetOptions = [ "--type=f" ] ++ defaultOptions;
-    tmux.enableShellIntegration = true;
-  };
-}

+ 4 - 86
home/features/cli/git.nix

@@ -1,11 +1,6 @@
 { pkgs, ... }: {
-  home.packages = [
-    pkgs.git
-    pkgs.git-crypt
-    pkgs.codeberg-cli
-  ];
 
-  programs.gh.enable = true;
+  home.packages = with pkgs; [ git-crypt ];
 
   programs.git = {
     enable = true;
@@ -33,74 +28,7 @@
       signer = "${pkgs.gnupg}/bin/gpg";
     };
 
-    aliases = {
-      b = "branch";
-      bc = "checkout -b";
-      bl = "branch -v";
-      bL = "branch -av";
-      bx = "branch -d";
-      bX = "branch -D";
-      bm = "branch -m";
-      bM = "branch -M";
-      bs = "show-branch";
-      bS = "show-branch -a";
-      co = "checkout";
-      co0 = "checkout HEAD --";
-      f = "fetch";
-      fm = "pull";
-      fo = "fetch origin";
-      m = "merge";
-      mom = "merge origin/master";
-      p = "push";
-      pa = "push --all";
-      pt = "push --tags";
-      r = "rebase";
-      ra = "rebase --abort";
-      rc = "rebase --continue";
-      ri = "rebase --interactive";
-      rs = "rebase --skip";
-      rom = "rebase origin/master";
-      c = "commit -v";
-      ca = "commit --all -v";
-      cm = "commit --message";
-      cam = "commit --all --message";
-      camend = "commit --amend --reuse-message HEAD";
-      cundo = "reset --soft 'HEAD^'";
-      cp = "cherry-pick";
-      d = "diff          # Diff working dir to index";
-      ds = "diff --staged # Diff index to HEAD";
-      dc = "diff --staged # Diff index to HEAD";
-      dh = "diff HEAD     # Diff working dir and index to HEAD";
-      hub = "browse";
-      hubd = "compare";
-      s = "status";
-      a = "add";
-      ia = "add";
-      ir = "reset";
-      l = "log --topo-order --pretty=format:'%C(yellow)%h %C(cyan)%cn %C(blue)%cr%C(reset) %s'";
-      ls = "log --topo-order --stat --pretty=format:'%C(bold)%C(yellow)Commit:%C(reset) %C(yellow)%H%C(red)%d%n%C(bold)%C(yellow)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)%C(yellow)Date:%C(reset)   %C(blue)%ai (%ar)%C(reset)%n%+B'";
-      ld = "log --topo-order --stat --patch --full-diff --pretty=format:'%C(bold)%C(yellow)Commit:%C(reset) %C(yellow)%H%C(red)%d%n%C(bold)%C(yellow)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)%C(yellow)Date:%C(reset)   %C(blue)%ai (%ar)%C(reset)%n%+B'";
-      lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
-      lga = "log --topo-order --all --graph --pretty=format:'%C(yellow)%h %C(cyan)%cn%C(reset) %s %C(red)%d%C(reset)%n'";
-      lm = "log --topo-order --pretty=format:'%s'";
-      lh = "shortlog --summary --numbered";
-      llf = "fsck --lost-found";
-      lg1 = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";
-      lg2 = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
-      re = "remote";
-      rel = "remote --verbose";
-      rea = "remote add";
-      rex = "remote rm";
-      rem = "remote rename";
-    };
-
     extraConfig = {
-      core = {
-        editor = "vim";
-        pager = "less -FRSX";
-        whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
-      };
-
       color = {
         grep = "always";
         pager = "true";
@@ -133,17 +61,15 @@
         };
       };
 
-      diff.tool = "vimdiff";
-      difftool.prompt = "false";
-      merge.tool = "vimdiff";
-      push.default = "matching";
-      pull.rebase = "false";
       init.defaultBranch = "master";
 
       url = {
         "[email protected]:" = {
           insteadOf = "github:";
         };
+        "[email protected]:" = {
+          insteadOf = "codeberg:";
+        };
       };
 
       branch = {
@@ -155,11 +81,3 @@
     };
   };
 }
-# [filter "lfs"]
-# 	clean = git-lfs clean -- %f
-# 	smudge = git-lfs smudge -- %f
-# 	process = git-lfs filter-process
-# 	required = true
-# TODO: Proton Drive
-# ln -s ~/Library/CloudStorage/[email protected]/Photos ~/Photos
-

+ 0 - 3
home/features/cli/github.nix

@@ -1,3 +0,0 @@
-{
-  programs.gh.enable = true;
-}

+ 0 - 3
home/features/cli/nostr.nix

@@ -1,3 +0,0 @@
-{ pkgs, ... }: {
-  home.packages = [ pkgs.unstable.nak ];
-}

+ 0 - 9
home/features/cli/pass.nix

@@ -1,9 +0,0 @@
-{ config, ... }: {
-  programs.password-store.enable = true;
-
-  programs.fish.shellInit = ''
-    set PASSWORD_STORE_DIR "${config.xdg.dataHome}/password-store";
-    set PASSWORD_STORE_KEY "7A53D4C6B481F7711588D34FDE749C31D060A160";
-    set PASSWORD_STORE_SIGNING_KEY "7A53D4C6B481F7711588D34FDE749C31D060A160";
-  '';
-}

+ 2 - 15
home/features/cli/ssh.nix

@@ -20,23 +20,10 @@ in
     '';
 
     matchBlocks = {
-      modgud = {
-        hostname = "modgud.t5.st";
-        user = "thomas";
-        remoteForwards = [
-          {
-            host.address = "${configHome}/S.gpg-agent.extra";
-            bind.address = "/run/user/1000/gnupg/d.o6jzqfigwppq1eps4nhng6n5/S.gpg-agent";
-          }
-          {
-            host.address = "${configHome}/S.gpg-agent.ssh";
-            bind.address = "/run/user/1000/gnupg/d.o6jzqfigwppq1eps4nhng6n5/S.gpg-agent.ssh";
-          }
-        ];
-      };
-
       "github.com".user = "git";
+      "codeberg.org".user = "git";
       github.hostname = "github.com";
+      codeberg.hostname = "codeberg.org";
     };
   };
 }

+ 28 - 37
home/features/cli/starship.nix

@@ -2,48 +2,39 @@
   programs.starship = {
     enable = true;
     enableFishIntegration = true;
-    enableNushellIntegration = true;
     enableTransience = true;
 
     settings = {
-      shell = {
-        disabled = false;
-        fish_indicator = "🐟";
-        nu_indicator = "☘️";
-        bash_indicator = "🐻";
-        zsh_indicator = "🐚";
+      palettes.kanagawa = {
+        rosewater = "#DCD7BA";
+        flamingo = "#E6C384";
+        pink = "#957FB8";
+        mauve = "#938AA9";
+        red = "#C34043";
+        maroon = "#E82424";
+        peach = "#C0A36E";
+        yellow = "#E6C384";
+        green = "#76946A";
+        teal = "#6A9589";
+        sky = "#7AA89F";
+        sapphire = "#7FB4CA";
+        blue = "#7E9CD8";
+        lavender = "#72A7BC";
+        text = "#DCD7BA";
+        subtext1 = "#C8C093";
+        subtext0 = "#98BB6C";
+        overlay2 = "#727169";
+        overlay1 = "#727169";
+        overlay0 = "#727169";
+        surface2 = "#2D4F67";
+        surface1 = "#2D4F67";
+        surface0 = "#2D4F67";
+        base = "#1F1F28";
+        mantle = "#16161D";
+        crust = "#16161D";
       };
 
-      palettes.catppuccin_frappe = {
-        rosewater = "#f2d5cf";
-        flamingo = "#eebebe";
-        pink = "#f4b8e4";
-        mauve = "#ca9ee6";
-        red = "#e78284";
-        maroon = "#ea999c";
-        peach = "#ef9f76";
-        yellow = "#e5c890";
-        green = "#a6d189";
-        teal = "#81c8be";
-        sky = "#99d1db";
-        sapphire = "#85c1dc";
-        blue = "#8caaee";
-        lavender = "#babbf1";
-        text = "#c6d0f5";
-        subtext1 = "#b5bfe2";
-        subtext0 = "#a5adce";
-        overlay2 = "#949cbb";
-        overlay1 = "#838ba7";
-        overlay0 = "#737994";
-        surface2 = "#626880";
-        surface1 = "#51576d";
-        surface0 = "#414559";
-        base = "#303446";
-        mantle = "#292c3c";
-        crust = "#232634";
-      };
-
-      palette = "catppuccin_frappe";
+      palette = "kanagawa";
     };
   };
 }

+ 4 - 9
home/features/cli/tmux.nix

@@ -1,14 +1,8 @@
 { pkgs
 , config
+, lib
 , ...
 }: {
-  # - WARNING Neither Tc nor RGB capability set. True colors are disabled. |'termguicolors'| won't work properly.
-  #   - ADVICE:
-  #     - Put this in your ~/.tmux.conf and replace XXX by your $TERM outside of tmux:
-  #       set-option -sa terminal-features ',XXX:RGB'
-  #     - For older tmux versions use this instead:
-  #       set-option -ga terminal-overrides ',XXX:Tc'
-
   programs.tmux = {
     sensibleOnTop = false;
 
@@ -19,8 +13,7 @@
     keyMode = "vi";
     mouse = true;
     prefix = "C-a";
-    # shell = "${pkgs.fish}/bin/fish";
-    shell = "${pkgs.lib.meta.getExe config.programs.fish.package}";
+    shell = "${lib.getExe config.programs.fish.package}";
     terminal = "tmux-256color";
 
     plugins = with pkgs.tmuxPlugins; [
@@ -29,6 +22,8 @@
         plugin = catppuccin;
         extraConfig = ''
           set -g @catppuccin_flavor 'frappe' # latte, frappe, macchiato or mocha
+          set -g @catppuccin_window_text " #W"
+          set -g @catppuccin_window_current_text " #W"
         '';
       }
       vim-tmux-focus-events

+ 0 - 4
home/features/cli/yazi.nix

@@ -1,4 +0,0 @@
-{
-  # TODO: add this theme at some point: https://github.com/catppuccin/yazi/tree/main
-  programs.yazi.enable = true;
-}

+ 0 - 6
home/features/cli/zoxide.nix

@@ -1,6 +0,0 @@
-{
-  programs.zoxide.enable = true;
-  programs.zoxide.options = [
-    "--cmd cd"
-  ];
-}