From f8f5398d96b34adb178b9b73ee8228e78eddd329 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 22 Aug 2023 19:10:12 +0200 Subject: Remove zsh config --- user/settings/zsh.nix | 127 -------------------------------------------------- 1 file changed, 127 deletions(-) delete mode 100644 user/settings/zsh.nix (limited to 'user/settings/zsh.nix') diff --git a/user/settings/zsh.nix b/user/settings/zsh.nix deleted file mode 100644 index 32070518..00000000 --- a/user/settings/zsh.nix +++ /dev/null @@ -1,127 +0,0 @@ -{ config -, lib -, pkgs -, ... -}: -let - inherit (pkgs) stdenv; - zshrc = ".config/zsh/.zshrc"; - mkZshPlugin = attrs@{ name, file ? "${name}.plugin.zsh", ... }: { - inherit name file; - src = stdenv.mkDerivation { - inherit (attrs) src; - name = "zsh-plugin-${attrs.name}"; - buildInputs = [ pkgs.zsh ]; - buildPhase = '' - zsh -c 'for f in **/*.zsh; zcompile "$f"' - ''; - installPhase = '' - cp -a $PWD $out/ - ''; - }; - }; -in -{ - home.packages = with pkgs; [ - zsh-completions - ]; - - home.sessionVariables = { - GHQ_ROOT = lib.mkDefault "${config.home.homeDirectory}/projects"; - }; - - programs.zsh = { - enable = true; - - enableAutosuggestions = true; - enableCompletion = true; - defaultKeymap = "emacs"; - - dotDir = ".config/zsh"; - - history = { - expireDuplicatesFirst = true; - extended = true; - path = "${config.home.homeDirectory}/.local/share/zsh/history"; - save = 200000; - size = 100000; - share = false; - ignorePatterns = [ - "rm *" - "trash *" - "pkill *" - "* aria2c *" - ]; - }; - - localVariables = { - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=8"; - }; - - plugins = map mkZshPlugin [ - { - name = "zsh-bd"; - file = "bd.plugin.zsh"; - src = pkgs.zsh-bd.src; - } - { - name = "zsh-autopair"; - src = pkgs.zsh-autopair.src; - } - { - name = "anyframe"; - src = pkgs.fetchFromGitHub { - owner = "mollifier"; - repo = "anyframe"; - rev = "598675303044df8e9d04722f3adff4f63a238922"; - # date = 2017-07-19T21:59:49+09:00; - sha256 = "08bjm1dd2mpv8rk8x6yvm6gj490rgimmiq7ln4jr5hik2k3mm82r"; - }; - } - { - name = "zsh-powerlevel10k"; - src = pkgs.zsh-powerlevel10k.src; - file = "dummy"; - } - ]; - - # Put this in /etc/paths.d/ on Darwin instead - envExtra = lib.optionalString (!stdenv.isDarwin) '' - if [[ ''${path[(I)$HOME/.local/bin ]} ]] - then - path=($HOME/.local/bin $path) - fi - ''; - - initExtraFirst = '' - if [[ $TERM != "dumb" ]] - then - if [[ -r "${config.xdg.cacheHome}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then - source "${config.xdg.cacheHome}/p10k-instant-prompt-''${(%):-%n}.zsh" - fi - typeset -g POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true - source $ZDOTDIR/plugins/zsh-powerlevel10k/powerlevel10k.zsh-theme - fi - ''; - initExtra = - '' - typeset -T GHQ_ROOT ghq_root - - function hist-freq-subcommands () { - fc -l -m "$1*" -10000 | cut -d' ' -f4- | sort | uniq -c | sort -gr | head -n100 | less - } - - source ${pkgs.fzf}/share/fzf/key-bindings.zsh - source ${pkgs.fzf}/share/fzf/completion.zsh - - '' - + builtins.readFile ../zsh/zshrc - + ( - if stdenv.isDarwin - then builtins.readFile ../zsh/zshrc.darwin - else "" - ); - }; - - home.file."${config.xdg.configHome}/zsh/.p10k.zsh".source = ../zsh/p10k.zsh; -} -- cgit 1.4.1