Commit 1d47091
Changed files (1)
modules
core
modules/core/shell.nix
@@ -56,5 +56,23 @@
'';
};
};
+
+ provides.to-users = {
+ hjem = {lib, ...}: {
+ files.".bashrc".text = lib.mkOrder 2000 ''
+ shopt -s histappend
+ __ix_history_flush() {
+ history -a
+ }
+ if [[ ";''${PROMPT_COMMAND[*]:-};" != *";__ix_history_flush;"* ]]; then
+ if [[ "$(declare -p PROMPT_COMMAND 2>&1)" == "declare -a"* ]]; then
+ PROMPT_COMMAND=(__ix_history_flush "''${PROMPT_COMMAND[@]}")
+ else
+ PROMPT_COMMAND="__ix_history_flush''${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
+ fi
+ fi
+ '';
+ };
+ };
};
}