From 33cb845cb1f5c431f707fc6b4a9518e6c6c9612c Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Wed, 9 Jun 2021 01:00:13 +0300 Subject: [PATCH] Persist zsh history better --- modules/security.nix | 2 ++ modules/workspace/zsh.nix | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/security.nix b/modules/security.nix index b01bf3e..80092c0 100644 --- a/modules/security.nix +++ b/modules/security.nix @@ -50,6 +50,8 @@ }; }; + persist.state.directories = [ "/home/balsoft/.config/Yubico" ]; + services.udev.extraRules = '' ACTION=="remove", ATTRS{idVendor}=="1050", RUN+="${pkgs.systemd}/bin/loginctl lock-sessions" ''; diff --git a/modules/workspace/zsh.nix b/modules/workspace/zsh.nix index 4e24393..84bd811 100755 --- a/modules/workspace/zsh.nix +++ b/modules/workspace/zsh.nix @@ -3,7 +3,8 @@ environment.pathsToLink = [ "/share/zsh" ]; environment.sessionVariables.SHELL = "zsh"; - persist.state.homeFiles = [ ".zsh_history" ]; + # A history file is screwed up otherwise :( + persist.state.directories = [ "/home/balsoft/.config/zsh/history" ]; home-manager.users.balsoft.programs.zsh = { enable = true; @@ -15,9 +16,12 @@ plugins = [ "git" "dirhistory" ]; }; + dotDir = ".config/zsh"; + history = rec { size = 1000000; save = size; + path = "$HOME/.config/zsh/history/file"; }; plugins = [ {