From f733e75c1d56ed9e7a2c5d45a383a5b26cfacfc6 Mon Sep 17 00:00:00 2001 From: Anton Volnuhin Date: Tue, 21 May 2024 02:25:07 +0300 Subject: [PATCH] configs consolidation --- run_once_after_configure.sh.tmpl | 7 ------- run_onchange_after_install_main_deps.sh.tmpl | 22 +++++++++++++++----- run_onchange_before_authorized_keys.sh | 10 --------- 3 files changed, 17 insertions(+), 22 deletions(-) delete mode 100755 run_once_after_configure.sh.tmpl delete mode 100755 run_onchange_before_authorized_keys.sh diff --git a/run_once_after_configure.sh.tmpl b/run_once_after_configure.sh.tmpl deleted file mode 100755 index 05451ca..0000000 --- a/run_once_after_configure.sh.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -set Green '\033[0;32m' # Green -set NC '\033[0m' # No Color - -{{ if eq .chezmoi.os "linux" -}} - sudo timedatectl set-timezone Europe/Moscow -{{ end -}} diff --git a/run_onchange_after_install_main_deps.sh.tmpl b/run_onchange_after_install_main_deps.sh.tmpl index 9c3354b..a5f75ab 100644 --- a/run_onchange_after_install_main_deps.sh.tmpl +++ b/run_onchange_after_install_main_deps.sh.tmpl @@ -1,6 +1,6 @@ #!/usr/bin/env bash #Config -STEPS=12 +STEPS=14 PAD_LEN=4 BASE_PACKAGES="gnupg curl wget git gcc pipx" @@ -86,6 +86,16 @@ pad() { print_block +new_line "Installing my authorized_keys" + +mkdir ~/.ssh 2>/dev/null || true +cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys.old 2>/dev/null || true + +##print only unique lines +cat ~/.ssh/authorized_keys.old <(echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdqIDeRKDOh7NQDcqnmLH/6M0ys7Wt/SEnF6ZYqroiH") 2>/dev/null | awk '!seen[$1]++' > ~/.ssh/authorized_keys + + + new_line "Update caches and upgrade packages" {{ if eq .chezmoi.os "darwin" -}} @@ -189,10 +199,12 @@ new_line "via NIX" tar xf lazygit.tar.gz lazygit 2>&1|pad sudo install lazygit /usr/local/bin 2>&1|pad - nix-env -iA nixpkgs.jump nixpkgs.skim nixpkgs.du-dust nixpkgs.atuin 2>&1|pad - {{ if eq .chezmoi.osRelease.id "debian" -}} - nix-env -iA nixpkgs.neovim 2>&1|pad - {{ end -}} + nix-env -iA nixpkgs.neovim nixpkgs.jump nixpkgs.skim nixpkgs.du-dust nixpkgs.atuin 2>&1|pad +{{ end -}} + +{{ if eq .chezmoi.os "linux" -}} + new_line "Setting timezone to Moscow" + sudo timedatectl set-timezone Europe/Moscow {{ end -}} new_line "Installing shell-gpt" diff --git a/run_onchange_before_authorized_keys.sh b/run_onchange_before_authorized_keys.sh deleted file mode 100755 index ebebb97..0000000 --- a/run_onchange_before_authorized_keys.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -cd -mkdir ~/.ssh - -cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys.old 2>/dev/null || true - -##print only unique lines -cat ~/.ssh/authorized_keys.old <(echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdqIDeRKDOh7NQDcqnmLH/6M0ys7Wt/SEnF6ZYqroiH") 2>/dev/null | awk '!seen[$1]++' > ~/.ssh/authorized_keys - -