diff --git a/nixos/modules/tmproot.nix b/nixos/modules/tmproot.nix index bfadae5..af68fc6 100644 --- a/nixos/modules/tmproot.nix +++ b/nixos/modules/tmproot.nix @@ -37,6 +37,11 @@ let if os.access(target, os.F_OK): recurse(target, link=p) return + + if ${if enablePersistence then "True" else "False"} and target.startswith('${cfg.persistence.dir}'): + # A symlink whose target cannot be accessed but starts with /persist... almost certaily re-generated on + # activation + return elif stat.S_ISDIR(st.st_mode): for e in os.listdir(p): recurse(os.path.join(p, e)) diff --git a/nixos/modules/user.nix b/nixos/modules/user.nix index 353b152..e5cd9b3 100644 --- a/nixos/modules/user.nix +++ b/nixos/modules/user.nix @@ -68,6 +68,7 @@ in parentDirectory = perms; }) [ "/home/${user'.name}/.bash_history" + "/home/${user'.name}/.lesshst" ]; directories = map (directory: { inherit directory;