From 0036cc2234435586df52524ce192f87a28f8e986 Mon Sep 17 00:00:00 2001 From: "Simen A. W. Olsen" Date: Sat, 21 Mar 2026 19:29:01 +0100 Subject: refactor(zsh): use nix to fetch zsh-snap instead of runtime git clone --- modules/home/zsh.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'modules/home') diff --git a/modules/home/zsh.nix b/modules/home/zsh.nix index 50a3fcf..840e553 100644 --- a/modules/home/zsh.nix +++ b/modules/home/zsh.nix @@ -1,7 +1,16 @@ { pkgs, ... }: +let + znap = pkgs.fetchFromGitHub { + owner = "marlonrichert"; + repo = "zsh-snap"; + rev = "main"; + hash = "sha256-wNxNraqlY3Uy4RTUl/2IwJqfUDz/mqILq5QPNrWZxi8="; + }; +in { home.file = { + ".zsh_repos/znap".source = znap; ".zshenv".text = '' ##!/bin/zsh # @@ -41,10 +50,6 @@ # https://github.com/koalaman/shellcheck/issues/809 # shellcheck disable=SC1090 # sourced filenames with variables - # Download Znap, if it's not there yet. - [[ -r ~/.zsh_repos/znap/znap.zsh ]] || - git clone --depth 1 -- \ - https://github.com/marlonrichert/zsh-snap.git ~/.zsh_repos/znap source ~/.zsh_repos/znap/znap.zsh # Start Znap znap eval starship 'starship init zsh --print-full-init' -- cgit v1.2.3