1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

secure mktemp

This commit is contained in:
2025-12-27 07:29:47 +01:00
parent b233c18709
commit 95e5a58f15
7 changed files with 15 additions and 8 deletions

View File

@@ -68,12 +68,19 @@ in {
};
};
environment.interactiveShellInit = ''
# Use XDG_RUNTIME_DIR for temporary files if available
if [ -d "$XDG_RUNTIME_DIR" ]; then
export TMPDIR="$XDG_RUNTIME_DIR"
fi
'';
environment.shellAliases = let
take = pkgs.writers.writeDash "take" ''
mkdir "$1" && cd "$1"
'';
cdt = pkgs.writers.writeDash "cdt" ''
cd "$(mktemp -d)"
cd $(mktemp -p "$XDG_RUNTIME_DIR" -d "cdt-XXXXXX")
pwd
'';
wcd = pkgs.writers.writeDash "wcd" ''