From 5e725b14bbe7ece89b288def8610d11b7eb3a2e9 Mon Sep 17 00:00:00 2001 From: Jake Hillion Date: Sat, 16 Mar 2024 14:15:22 +0000 Subject: [PATCH] impermenance: fix zsh history file --- modules/impermanence.nix | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/impermanence.nix b/modules/impermanence.nix index 3e54889..37c161b 100644 --- a/modules/impermanence.nix +++ b/modules/impermanence.nix @@ -58,23 +58,28 @@ in mkUser = (x: { name = x; value = { - home.persistence."/data/users/${x}" = { - allowOther = false; + home = { + persistence."/data/users/${x}" = { + allowOther = false; - files = [ - ".zsh_history" - ] ++ cfg.userExtraFiles.${x} or [ ]; - - directories = cfg.userExtraDirs.${x} or [ ]; + files = cfg.userExtraFiles.${x} or [ ]; + directories = cfg.userExtraDirs.${x} or [ ]; + }; + file.".zshrc".text = lib.mkForce '' + HISTFILE=/data/users/${x}/.zsh_history + ''; }; }; }); in builtins.listToAttrs (builtins.map mkUser cfg.users); - systemd.tmpfiles.rules = builtins.map + systemd.tmpfiles.rules = lib.lists.flatten (builtins.map (user: - let details = config.users.users.${user}; in "L ${details.home}/local - ${user} ${details.group} - /data/users/${user}") - cfg.users; + let details = config.users.users.${user}; in [ + "d /data/users/${user} 0700 ${user} ${details.group} - -" + "L ${details.home}/local - ${user} ${details.group} - /data/users/${user}" + ]) + cfg.users); }; }