From 3aa67d34b49b903e46c9ebad1b04dd6259f333ea Mon Sep 17 00:00:00 2001 From: 1ndev <1ndevelopment@protonmail.com> Date: Sat, 14 Dec 2024 09:43:02 -0800 Subject: [PATCH] init commit --- .zshrc.kate-swp | Bin 0 -> 668 bytes configure_system.sh | 159 +++++++++++++++++++++++++++++++++++++++----- install_nix.sh | 76 --------------------- install_ohmyzsh.sh | 9 --- zshrc | 48 ------------- 5 files changed, 143 insertions(+), 149 deletions(-) create mode 100644 .zshrc.kate-swp delete mode 100755 install_nix.sh delete mode 100755 install_ohmyzsh.sh delete mode 100644 zshrc diff --git a/.zshrc.kate-swp b/.zshrc.kate-swp new file mode 100644 index 0000000000000000000000000000000000000000..c747b2f3738dfe32170e29e37e03c6b674d11145 GIT binary patch literal 668 zcmYk3%}T>S6h^1IPzn~T{Yjd%No)UW)8M)&3Mq&S(NuJ4kS>ZYL<%lSAHlZ}U%}_` z348@}lAAIEIWy;emzgl5lqz0FtA!hWL~rhF`MPjVJzptR`rTYS{;c<&_Fw+a-#@3D zue0yl@GefQ_+#XeTC!9scONgTAY`hglbKFN5MIT_qpWfLAeN(Cl5+kzTDjAy8{Eu- zF1S6)O+y)C<)IY~v5OQbB)MYea2Y~O{K w^T7moU<^*c2n@jh^g$1FK?k(KF=&A%aDf9Fpbl(cff_J@0ji(^%Aged0}gFD4gdfE literal 0 HcmV?d00001 diff --git a/configure_system.sh b/configure_system.sh index 05d65ae..f6f15ee 100755 --- a/configure_system.sh +++ b/configure_system.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh echo '' -echo "Disable read-only ? [y/n] (Enables System RW)" +echo "Disable read-only & populate keyring ? [y/n] (Enables System RW / AUR packages)" read inputrw if [[ $inputrw =~ ^[Yy]$ ]]; then sudo steamos-readonly disable @@ -10,6 +10,102 @@ if [[ $inputrw =~ ^[Yy]$ ]]; then sudo pacman -Syu sudo pacman -Sy archlinux-keyring fi + +echo '' +echo "Install yay ? [y/n]" +read inputyay +if [[ $inputjre =~ ^[Yy]$ ]]; then + git clone https://aur.archlinux.org/yay-bin.git + cd yay-bin + git checkout 96f90180a3cf72673b1769c23e2c74edb0293a9f + makepkg -si +fi + +echo '' +echo "Install nix ? [y/n]" +read inputnix +if [[ $inputnix =~ ^[Yy]$ ]]; then +{ +sudo cat << EOF +[Unit] +Description=Create a `/nix` directory to be used for bind mounting +PropagatesStopTo=nix-daemon.service +PropagatesStopTo=nix.mount +DefaultDependencies=no +After=grub-recordfail.service +After=steamos-finish-oobe-migration.service + +[Service] +Type=oneshot +ExecStart=steamos-readonly disable +ExecStart=mkdir -vp /nix +ExecStart=chmod -v 0755 /nix +ExecStart=chown -v root /nix +ExecStart=chgrp -v root /nix +ExecStart=steamos-readonly enable +ExecStop=steamos-readonly disable +ExecStop=rmdir /nix +ExecStop=steamos-readonly enable +RemainAfterExit=true +EOF +} > /etc/systemd/system/nix-directory.service +{ +sudo cat << EOF +[Unit] +Description=Mount `/home/nix` on `/nix` +PropagatesStopTo=nix-daemon.service +PropagatesStopTo=nix-directory.service +After=nix-directory.service +Requires=nix-directory.service +ConditionPathIsDirectory=/nix +DefaultDependencies=no + +[Mount] +What=/home/nix +Where=/nix +Type=none +DirectoryMode=0755 +Options=bind +EOF +} > /etc/systemd/system/nix.mount +{ +sudo cat << EOF +[Unit] +Description=Ensure Nix related units which are symlinked resolve +After=nix.mount +Requires=nix-directory.service +Requires=nix.mount +PropagatesStopTo=nix-directory.service +PropagatesStopTo=nix.mount +DefaultDependencies=no + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/systemctl daemon-reload +ExecStart=/usr/bin/systemctl restart --no-block sockets.target timers.target multi-user.target + +[Install] +WantedBy=sysinit.target +EOF +} > /etc/systemd/system/ensure-symlinked-units-resolve.service + sudo systemctl daemon-reload + sudo systemctl enable --now ensure-symlinked-units-resolve.service + sh <(curl -L https://nixos.org/nix/install) --daemon + sudo echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf +fi + +echo '' +echo "Install/Enable pip ? [y/n]" +read inputpip +if [[ $inputpip =~ ^[Yy]$ ]]; then + sudo pacman -S python3 + wget https://bootstrap.pypa.io/get-pip.py + python3 get-pip.py --user --break-system-packages + sudo rm get-pip.py +fi + + echo '' echo "Enable verbose boot ? [y/n]" read inputverbose @@ -18,6 +114,7 @@ if [[ $inputverbose =~ ^[Yy]$ ]]; then sudo mv temp_file /etc/grub.d/00_header sudo update-grub fi + echo '' echo "Install/Enable tailscale (VPN) ? [y/n]" read inputvpn @@ -28,6 +125,7 @@ if [[ $inputvpn =~ ^[Yy]$ ]]; then source /etc/profile.d/tailscale.sh sudo tailscale up --operator=deck --ssh fi + echo '' echo "Install/Enable no machine (NX) ? [y/n]" read inputrx @@ -38,12 +136,14 @@ if [[ $inputrx =~ ^[Yy]$ ]]; then sudo /usr/NX/nxserver --install redhat sudo rm -r /usr/nomachine_8.14.2_1_x86_64.tar.gz fi + echo '' echo "Install Android Tools (adb) ? [y/n]" read inputadb if [[ $inputadb =~ ^[Yy]$ ]]; then sudo pacman -S --noconfirm android-tools fi + echo '' echo "Install Docker ? [y/n]" read inputdocker @@ -51,14 +151,7 @@ if [[ $inputdocker =~ ^[Yy]$ ]]; then sudo pacman -S --noconfirm docker systemctl start docker fi -echo '' -echo "Install/Enable pip ? [y/n]" -read inputpip -if [[ $inputpip =~ ^[Yy]$ ]]; then - wget https://bootstrap.pypa.io/get-pip.py - python3 get-pip.py --user --break-system-packages - sudo rm get-pip.py -fi + echo '' echo "Install JDK 21 ? [y/n]" read inputjre @@ -69,12 +162,46 @@ if [[ $inputjre =~ ^[Yy]$ ]]; then JDK_VERSION=21 ./install-jdk-on-steam-deck/scripts/install-jdk.sh && \ sudo rm -r ./install-jdk-on-steam-deck fi + echo '' -echo "Install yay ? [y/n]" -read inputyay -if [[ $inputjre =~ ^[Yy]$ ]]; then - git clone https://aur.archlinux.org/yay-bin.git - cd yay-bin - git checkout 96f90180a3cf72673b1769c23e2c74edb0293a9f - makepkg -si +echo "Install Oh My Zsh shell ? [y/n]" +read inputohmyzsh +if [[ $inputohmyzsh =~ ^[Yy]$ ]]; then + sudo pacman -S zsh lsd git wget + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + sed -i 's/^ZSH_THEME=.*$/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc + git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions + sed -i 's/plugins=(\(git\))/plugins=(\n \1\n zsh-autosuggestions\n)/' ~/.zshrc + sudo wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20{Regular,Bold,Italic,Bold%20Italic}.ttf -P /usr/share/fonts/MesloLGS/ +{ +cat << EOF +export WORK_WEEK=\$(date "+%yww%W.%u") +export LAN_IP=\$(ip -json route get 8.8.8.8 | jq -r '.[].prefsrc') +export TAILSCALE_IP=\$(tailscale status | awk '{print \$1}' | awk 'NR == 1 {print}') + +alias ls='lsd' +alias dir='ls -1a' +alias cls='clear' +alias x='exit' +alias n='nano' +alias biggest='du . -ha | sort -hr | head -n $1' +alias ifconfig="ip add" + +alias nixins='nix-env -iA nixpkgs.$1' +alias nixfind='nix search nixpkgs $1' + +alias fpl='flatpak list' + +alias pmins='sudo pacman -S' +alias pmuni='sudo pacman -R' +alias pmupd='sudo pacman -Sy' +alias pmupg='sudo pacman -Syyu' +alias pmlst='sudo pacman -Q' +alias pmlstin='sudo pacman -Qe' + +alias browser='lynx https://search.1ndev.com/' +alias androidscreen="scrcpy -w" +EOF +} >> ~/.zshrc fi diff --git a/install_nix.sh b/install_nix.sh deleted file mode 100755 index 4cd00cd..0000000 --- a/install_nix.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env sh -{ -sudo cat << EOF -[Unit] -Description=Create a `/nix` directory to be used for bind mounting -PropagatesStopTo=nix-daemon.service -PropagatesStopTo=nix.mount -DefaultDependencies=no -After=grub-recordfail.service -After=steamos-finish-oobe-migration.service - -[Service] -Type=oneshot -ExecStart=steamos-readonly disable -ExecStart=mkdir -vp /nix -ExecStart=chmod -v 0755 /nix -ExecStart=chown -v root /nix -ExecStart=chgrp -v root /nix -ExecStart=steamos-readonly enable -ExecStop=steamos-readonly disable -ExecStop=rmdir /nix -ExecStop=steamos-readonly enable -RemainAfterExit=true -EOF -} > /etc/systemd/system/nix-directory.service -{ -sudo cat << EOF -[Unit] -Description=Mount `/home/nix` on `/nix` -PropagatesStopTo=nix-daemon.service -PropagatesStopTo=nix-directory.service -After=nix-directory.service -Requires=nix-directory.service -ConditionPathIsDirectory=/nix -DefaultDependencies=no - -[Mount] -What=/home/nix -Where=/nix -Type=none -DirectoryMode=0755 -Options=bind -EOF -} > /etc/systemd/system/nix.mount -{ -sudo cat << EOF -[Unit] -Description=Ensure Nix related units which are symlinked resolve -After=nix.mount -Requires=nix-directory.service -Requires=nix.mount -PropagatesStopTo=nix-directory.service -PropagatesStopTo=nix.mount -DefaultDependencies=no - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/systemctl daemon-reload -ExecStart=/usr/bin/systemctl restart --no-block sockets.target timers.target multi-user.target - -[Install] -WantedBy=sysinit.target -EOF -} > /etc/systemd/system/ensure-symlinked-units-resolve.service - -sudo systemctl daemon-reload -sudo systemctl enable --now ensure-symlinked-units-resolve.service - - -sh <(curl -L https://nixos.org/nix/install) --daemon - - -sudo echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf - -# echo "export XDG_DATA_DIRS="$HOME/.nix-profile/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" >> diff --git a/install_ohmyzsh.sh b/install_ohmyzsh.sh deleted file mode 100755 index 39f25a6..0000000 --- a/install_ohmyzsh.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env sh -sudo pacman -S zsh lsd git wget -sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" -git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k -sed -i 's/^ZSH_THEME=.*$/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc -echo "alias ls='lsd'" >> ~/.zshrc -git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions -sed -i 's/plugins=(\(git\))/plugins=(\n \1\n zsh-autosuggestions\n)/' ~/.zshrc -sudo wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20{Regular,Bold,Italic,Bold%20Italic}.ttf -P /usr/share/fonts/MesloLGS/ diff --git a/zshrc b/zshrc deleted file mode 100644 index 67f7d2d..0000000 --- a/zshrc +++ /dev/null @@ -1,48 +0,0 @@ -# Initialization code that may require console input (password prompts, [y/n] -# confirmations, etc.) must go above this block; everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" -fi -export PATH="$HOME/.local/bin:$HOME/.local/jdk:/opt/tailscale:$PATH" ZSH="$HOME/.oh-my-zsh" - -ZSH_THEME="powerlevel10k/powerlevel10k" - -plugins=( - git - zsh-autosuggestions -) - -source $ZSH/oh-my-zsh.sh - -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh - -## User Config - -export WORK_WEEK=$(date "+%yww%W.%u") -export LAN_IP=$(ip -json route get 8.8.8.8 | jq -r '.[].prefsrc') -# export TAILSCALE_IP=$(tailscale status | awk '{print $1}' | awk 'NR == 1 {print}') - -alias ls='lsd' -alias dir='ls -1a' -alias cls='clear' -alias x='exit' -alias n='nano' -alias biggest='du . -ha | sort -hr | head -n $1' -alias ifconfig="ip add" - -alias nixins='nix-env -iA nixpkgs.$1' -alias nixfind='nix search nixpkgs $1' - -alias fpl='flatpak list' - -alias pmins='sudo pacman -S' -alias pmuni='sudo pacman -R' -alias pmupd='sudo pacman -Sy' -alias pmupg='sudo pacman -Syyu' -alias pmlst='sudo pacman -Q' -alias pmlstin='sudo pacman -Qe' - -alias browser='lynx https://search.1ndev.com/' -alias androidscreen="scrcpy -w" - -## End of User Config