From c0b9c8c54da7fdbe2bca5d6a637f530525f92834 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sun, 10 Sep 2023 12:50:33 +0200 Subject: fix home link making --- nixpkgs/kusanagi.nix | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/nixpkgs/kusanagi.nix b/nixpkgs/kusanagi.nix index 1ce4be3..6f43dc9 100644 --- a/nixpkgs/kusanagi.nix +++ b/nixpkgs/kusanagi.nix @@ -9,17 +9,27 @@ in { imports = [ ./common.nix ]; programs.bash.profileExtra = '' - ln -sf /Z/lx/Downloads ~/Downloads + function mklink { + if [ ! -L "$2" ]; then + ln -sfv "$1" "$2" + fi + } - ln -sf /Z/lx/app/openssh ~/.ssh + mklink /Z/lx/Downloads ~/Downloads + + mklink /Z/lx/app/openssh ~/.ssh mkdir -p ~/.gnupg - ln -sf /Z/lx/app/gnupg/pubring.kbx ~/.gnupg/ - ln -sf /Z/lx/app/gnupg/trustdb.gpg ~/.gnupg/ - ln -sf /Z/lx/app/gnupg/private-keys-v1.d ~/.gnupg/ - ln -sf /Z/lx/app/cargo ~/.cargo + mklink /Z/lx/app/gnupg/pubring.kbx ~/.gnupg/pubring.kbx + mklink /Z/lx/app/gnupg/trustdb.gpg ~/.gnupg/trustdb.gpg + mklink /Z/lx/app/gnupg/private-keys-v1.d ~/.gnupg/private-keys-v1.d + mklink /Z/lx/app/cargo ~/.cargo + + mklink /Z/lx/app/arduino/Arduino ~/Arduino + mklink /Z/lx/app/arduino/.arduino15 ~/.arduino15 - ln -sf /Z/lx/app/arduino/Arduino ~/Arduino - ln -sf /Z/lx/app/arduino/.arduino15 ~/.arduino15 + mkdir -p ~/.local/share/Steam + mklink /Z/lx/app/steam/.steam ~/.steam + mklink /Z/lx/app/steam/Steam ~/.local/share/Steam ''; programs.bash.shellAliases.z = "cd /Z/lx"; -- cgit v1.2.3