From 7efb6e59b5d3fceae953863512499c7789446317 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Tue, 5 Apr 2022 17:02:37 +0300 Subject: [PATCH] feat(nix/prog/zsh): add history opts and init nix --- nix/home.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/nix/home.nix b/nix/home.nix index 66aa325..feb98ca 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -28,12 +28,29 @@ in defaultKeymap = "viins"; dotDir = ".config/zsh"; - history.path = "${config.xdg.dataHome}/zsh/zsh_history"; + history = { + path = "${config.xdg.dataHome}/zsh/zsh_history"; + expireDuplicatesFirst = true; + ignorePatterns = [ + "rm *" + "kill *" + ]; + }; oh-my-zsh = { enable = true; theme = "robbyrussell"; }; + + initExtraFirst = '' + if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then + source $HOME/.nix-profile/etc/profile.d/nix.sh; + fi + + source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh + + export NIX_PATH=$HOME/.nix-defexpr/channels''${NIX_PATH:+:$NIX_PATH} + ''; }; programs.git = {