Skip to content

Commit

Permalink
Ref: Update scritps
Browse files Browse the repository at this point in the history
Ref: Update scritps

Squash

Tweak script

Squash
  • Loading branch information
AlexvZyl committed Jun 3, 2024
1 parent f5d2fee commit 90f8321
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 210 deletions.
36 changes: 25 additions & 11 deletions .scripts/install/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
#!/bin/bash

if [ -z ${SUDO_USER} ]
# TODO(alex): Which of these can be done with Nix?

# Get user.
if [ -z "${SUDO_USER}" ]
then
export USER_HOME="$HOME"
else
export USER_HOME="/home/${SUDO_USER}"
fi

# Clone.
sudo pacman -S git
# Clone and build
nix-env --install git

mkdir ~/.dotfiles
git --git-dir=$USER_HOME/.dotfiles/ --work-tree=$USER_HOME clone --bare https://github.com/AlexvZyl/.dotfiles $USER_HOME/.dotfiles/
git --git-dir=$USER_HOME/.dotfiles/ --work-tree=$USER_HOME checkout -f
source $USER_HOME/.profile
git --git-dir="$USER_HOME/.dotfiles/" --work-tree="$USER_HOME" clone --bare https://github.com/AlexvZyl/.dotfiles "$USER_HOME/.dotfiles/"
git --git-dir="$USER_HOME/.dotfiles/" --work-tree="$USER_HOME" checkout -f

# Needed for install.
$USER_HOME/.scripts/install/links.sh
source "$USER_HOME/.profile"
nix-build

# Setup git.
# Setup GitHub.
gh auth login
gh extension install dlvhdr/gh-dash
config config --local status.showUntrackedFiles no
git config --global user.email "alexandervanzyl@protonmail.com"
git config --global user.name "AlexvZyl"

# Get modules.
config submodule update --init --force --remote .password-store/
Expand All @@ -28,5 +34,13 @@ config submodule update --init --force --remote .modules/user.js/
config submodule update --init --force --remote .config/nvim/
config submodule update --init --force --remote .tmux/plugins/tpm

# Run main install script.
$USER_HOME/.scripts/install/install.sh
# Setup ssh.
sudo rm -rdf "$USER_HOME/.ssh"
sudo ln -f -s -d "$USER_HOME/.private/.ssh/" "$USER_HOME/"
chmod +x 600 ~/.ssh/

# Tmux
"$USER_HOME/.tmux/plugins/tpm/bin/install_plugins"

config config pull.rebase=true
config config remote.origin.url=git@github.com:AlexvZyl/.dotfiles.git
24 changes: 0 additions & 24 deletions .scripts/install/display.sh

This file was deleted.

35 changes: 0 additions & 35 deletions .scripts/install/hardware.sh

This file was deleted.

14 changes: 0 additions & 14 deletions .scripts/install/install.sh

This file was deleted.

9 changes: 0 additions & 9 deletions .scripts/install/links.sh

This file was deleted.

75 changes: 0 additions & 75 deletions .scripts/install/minimal_workspace.sh

This file was deleted.

8 changes: 0 additions & 8 deletions .scripts/install/misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@
source "$(dirname $0)/../utils.sh"

# Cron.
crontab $USER_HOME/.config/cron/crontab
sudo systemctl enable cronie

# Enable SysRq keys.
sudo touch /etc/sysctl.d/99-sysctl.conf
sudo sh -c "echo 'kernel.sysrq=1' >> /etc/sysctl.d/99-sysctl.conf"

# Add bnaries to sudoers.
sudo sh -c "echo '$USER ALL = NOPASSWD: /usr/bin/s-tui, /usr/bin/pacman, /usr/bin/fail2ban-client' >> /etc/sudoers"

# Github
gh extension install dlvhdr/gh-dash
34 changes: 0 additions & 34 deletions .scripts/install/security.sh

This file was deleted.

0 comments on commit 90f8321

Please sign in to comment.