From 3ace3590ab885cc1f244c9cdab32960956b96ef3 Mon Sep 17 00:00:00 2001 From: OCbwoy3 Date: Wed, 12 Mar 2025 17:06:01 +0200 Subject: [PATCH] C --- hosts/default/other/activate.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hosts/default/other/activate.nix b/hosts/default/other/activate.nix index 76f0d4b..2668b1c 100644 --- a/hosts/default/other/activate.nix +++ b/hosts/default/other/activate.nix @@ -37,19 +37,18 @@ system.activationScripts.makeDirs = { text = '' - export USER=ocbwoy3 create_dir() { - mkdir -p "$1" - chown $USER:$USER "$1" - chmod 700 "$1" + trap "USER=ocbwoy3 mkdir -p \"$1\"" EXIT + trap "USER=ocbwoy3 chown ocbwoy3:ocbwoy3 \"$1\" EXIT + trap "USER=ocbwoy3 chmod 700 \"$1\"" EXIT } - trap "create_dir /home/$USER/Pictures/Screenshots" EXIT - trap "create_dir /home/$USER/Downloads" EXIT - trap "create_dir /home/$USER/Desktop" EXIT - trap "create_dir /home/$USER/Documents" EXIT - trap "create_dir /home/$USER/Projects" EXIT + create_dir /home/$USER/Pictures/Screenshots + create_dir /home/$USER/Downloads + create_dir /home/$USER/Desktop + create_dir /home/$USER/Documents + create_dir /home/$USER/Projects ''; };