From f7eda8ca1c40214c4361d14ce96174d62ce6233e Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 5 Jun 2022 03:07:50 +0200 Subject: [PATCH 1/2] zsh: bundle plugins within our config --- modules/terminal-life/zsh/default.nix | 57 ++++++++++++++++++++------- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index 2db8bc41..63da73ca 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -39,21 +39,48 @@ in nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat"; myip = "dig +short myip.opendns.com @208.67.222.222 2>&1"; }; - zplug = { - enable = true; - plugins = [ - { - name = "plugins/z"; - tags = [ "from:oh-my-zsh" ]; - } - { - name = "romkatv/powerlevel10k"; - tags = [ "as:theme" "depth:1" ]; - } - { name = "zdharma/fast-syntax-highlighting"; } - { name = "chisui/zsh-nix-shell"; } - ]; - }; + plugins = [ + { + # will source ohmyzsh/plugins/z/ + name = "zsh-plugins-z"; + file = "plugins/z/z.sh"; + src = pkgs.fetchFromGitHub { + owner = "ohmyzsh"; + repo = "ohmyzsh"; + rev = "master"; + sha256 = "sha256-NAVotL5RxpS/zKnO+ngMIjv787lqc1dj/c4blQrQcvU="; + }; + } + { + name = "zsh-powerlevel10k"; + file = "powerlevel10k.zsh-theme"; + src = pkgs.fetchFromGitHub { + owner = "romkatv"; + repo = "powerlevel10k"; + rev = "master"; + sha256 = "sha256-0pzkKPdzyQXTe8usaSaM1Iivi2UHQrSJrh5V2pRdiGg="; + }; + } + { + name = "zsh-fast-syntax-highlighting"; + src = pkgs.fetchFromGitHub { + owner = "zdharma"; + repo = "fast-syntax-highlighting"; + rev = "master"; + sha256 = "sha256-uoLrXfq31GvfHO6GTrg7Hus8da2B4SCM1Frc+mRFbFc="; + }; + } + { + name = "zsh-nix-shell"; + file = "nix-shell.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "master"; + sha256 = "sha256-BjgMhILEL/qdgfno4LR64LSB8n9pC9R+gG7IQWwgyfQ="; + }; + } + ]; initExtra = '' bindkey -v From de03f0f42fbd61968dedf26e761f9f618d20617f Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 17 Jul 2022 16:37:09 +0200 Subject: [PATCH 2/2] zsh: correctly pin plugins to commits instead of branch names, to prevent errors like: error: hash mismatch in fixed-output derivation '/nix/store/n7w9jd46zx4rzy9a24abxv3lcx1ikn1j-source.drv': specified: sha256-0pzkKPdzyQXTe8usaSaM1Iivi2UHQrSJrh5V2pRd0Gg= got: sha256-9vc4cMBCNOmPOyzGwnPeMrXXyQUq4pC9Du3AWl9+Rys= --- modules/terminal-life/zsh/default.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index 63da73ca..b68a4270 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -47,7 +47,7 @@ in src = pkgs.fetchFromGitHub { owner = "ohmyzsh"; repo = "ohmyzsh"; - rev = "master"; + rev = "249c708ed3a4a7a63d16a6e911a46b6fb9623cbd"; sha256 = "sha256-NAVotL5RxpS/zKnO+ngMIjv787lqc1dj/c4blQrQcvU="; }; } @@ -57,17 +57,18 @@ in src = pkgs.fetchFromGitHub { owner = "romkatv"; repo = "powerlevel10k"; - rev = "master"; - sha256 = "sha256-0pzkKPdzyQXTe8usaSaM1Iivi2UHQrSJrh5V2pRdiGg="; + rev = "2dd6a29e4d7a33bfef10973d6550e087be37ddee"; + sha256 = "sha256-9vc4cMBCNOmPOyzGwnPeMrXXyQUq4pC9Du3AWl9+Rys="; }; } { name = "zsh-fast-syntax-highlighting"; + file = "F-Sy-H.plugin.zsh"; src = pkgs.fetchFromGitHub { - owner = "zdharma"; - repo = "fast-syntax-highlighting"; - rev = "master"; - sha256 = "sha256-uoLrXfq31GvfHO6GTrg7Hus8da2B4SCM1Frc+mRFbFc="; + owner = "z-shell"; + repo = "F-Sy-H"; + rev = "c4bdc485b67b58351a24f21fcac92c9e0232b939"; + sha256 = "sha256-uXBGIdJwubuueNhQRdGxPUi0eJN17cflYAuHTjeQ8FQ="; }; } { @@ -76,7 +77,7 @@ in src = pkgs.fetchFromGitHub { owner = "chisui"; repo = "zsh-nix-shell"; - rev = "master"; + rev = "af6f8a266ea1875b9a3e86e14796cadbe1cfbf08"; sha256 = "sha256-BjgMhILEL/qdgfno4LR64LSB8n9pC9R+gG7IQWwgyfQ="; }; }