From 4cd54f90d22015256a9ad65e2ac199ee83721475 Mon Sep 17 00:00:00 2001 From: Ivan Bushchik Date: Sun, 30 Jul 2023 15:13:22 +0300 Subject: [PATCH] Add NixOS (just link and install plugins) installation script. Signed-off-by: Ivan Bushchik --- configs/.zshrc | 1 + init_nix | 11 +++++++++++ tools/install_nix.sh | 12 ++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 init_nix create mode 100755 tools/install_nix.sh diff --git a/configs/.zshrc b/configs/.zshrc index 950ab74..c746378 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -50,6 +50,7 @@ alias timestamp='date -u +%FT%TZ' alias yt-dlp-opus="yt-dlp -f 251 -x" alias ltcp="cp ~/.dotfiles/latex_template/{macros,preamble,template,letterfonts}.tex ." alias jekyll_export="jekyll b -d ./_archive && cd _archive && tar cf ../site.tar ./ && cd .. && gzip -9 -f site.tar && rm -rf _archive" +alias rebuild="sudo nixos-rebuild switch --flake path:/etc/nixos --impure" # ffmpeg section diff --git a/init_nix b/init_nix new file mode 100644 index 0000000..02608f4 --- /dev/null +++ b/init_nix @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +if ! command -v git &> /dev/null +then + echo "git should be installed" + exit 255 +fi + +git clone https://github.com/ivabus/dotfiles $HOME/.dotfiles +exec sh $HOME/.dotfiles/tools/install_nix.sh < /dev/tty diff --git a/tools/install_nix.sh b/tools/install_nix.sh new file mode 100755 index 0000000..b017aa4 --- /dev/null +++ b/tools/install_nix.sh @@ -0,0 +1,12 @@ +#/bin/sh +set -e + +mkdir $HOME/.config +./relink.sh +mkdir -p $HOME/.dotfiles/zsh/{plugins,themes} +ZSH="$HOME/.dotfiles/zsh" +echo "Installing zsh theme and plugins" +curl -fsSL https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme -o $HOME/.dotfiles/zsh/themes/ivabus.zsh-theme +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.dotfiles/zsh/plugins/zsh-syntax-highlighting +curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +nvim -c :PlugInstall -c :q -c :q