From f89bd9e84fe7cf56790bd2988ad0448f10290182 Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Fri, 14 Jun 2024 17:59:27 +0300 Subject: [PATCH] Fix zsh impermanence https://logs.nix.samueldr.com/nixos-chat/2020-06-07 Signed-off-by: Nikolaos Karaolidis --- hosts/common/configs/zsh.nix | 5 ++++- hosts/common/default.nix | 4 ++-- users/common/configs/zsh.nix | 5 ++++- users/common/default.nix | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hosts/common/configs/zsh.nix b/hosts/common/configs/zsh.nix index 5b95235..6c1512c 100644 --- a/hosts/common/configs/zsh.nix +++ b/hosts/common/configs/zsh.nix @@ -1,3 +1,6 @@ { - programs.zsh.enable = true; + programs.zsh = { + enable = true; + histFile = "/var/lib/zsh/history"; + }; } diff --git a/hosts/common/default.nix b/hosts/common/default.nix index a93d00b..8a54d1a 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -34,13 +34,13 @@ "/etc/nixos" "/etc/NetworkManager/system-connections" "/var/lib/nixos" - "/var/log" "/var/lib/systemd/coredump" + "/var/lib/zsh" + "/var/log" ]; files = [ "/etc/ssh/ssh_host_ed25519_key" "/etc/machine-id" - "/root/.zsh_history" ]; }; diff --git a/users/common/configs/zsh.nix b/users/common/configs/zsh.nix index 05c2ef2..7b014b9 100644 --- a/users/common/configs/zsh.nix +++ b/users/common/configs/zsh.nix @@ -2,7 +2,10 @@ programs.zsh = { enable = true; autocd = true; - history.expireDuplicatesFirst = true; + history = { + path = "$HOME/.local/share/zsh/history"; + expireDuplicatesFirst = true; + }; historySubstringSearch.enable = true; autosuggestion.enable = true; syntaxHighlighting.enable = true; diff --git a/users/common/default.nix b/users/common/default.nix index 857a4b4..caad225 100644 --- a/users/common/default.nix +++ b/users/common/default.nix @@ -72,10 +72,10 @@ in "VMs" "git" ".mozilla" + ".local/share/zsh" ]; files = [ - ".zsh_history" - ".key.txt" + ".local/share/sops-nix/key.txt" ]; allowOther = true; };