Compare commits
8 Commits
9778a1bcd5
...
main
Author | SHA1 | Date | |
---|---|---|---|
b25a30615b | |||
452ce614ef | |||
0d520f7bbf | |||
f560e4a942 | |||
4fdd55da97 | |||
6329e7230d | |||
8730ff086a | |||
2ae78ecfaf |
@@ -1,8 +1,9 @@
|
||||
{{- $email := promptStringOnce . "email" "What's your email?" }}
|
||||
{{- $git_name := promptStringOnce . "git_name" "What's your Git name?" }}
|
||||
{{- $email := promptStringOnce . "email" "What's your email" }}
|
||||
{{- $git_name := promptStringOnce . "git_name" "What's your Git name" }}
|
||||
|
||||
{{- $shell := promptBoolOnce . "features.shell" "Do you want to install the Fish shell?" true }}
|
||||
{{- $git := promptBoolOnce . "features.git" "Do you want to install Git?" true }}
|
||||
{{- $shell := promptBoolOnce . "features.shell" "Do you want to install the Fish shell" true }}
|
||||
{{- $git := promptBoolOnce . "features.git" "Do you want to install Git" true }}
|
||||
{{- $editor := promptBoolOnce . "features.editor" "Do you want to install Neovim" true }}
|
||||
|
||||
[data]
|
||||
email = {{ $email | quote }}
|
||||
@@ -11,3 +12,4 @@ git_name = {{ $git_name | quote }}
|
||||
[data.features]
|
||||
shell = {{ $shell }}
|
||||
git = {{ $git }}
|
||||
editor = {{ $editor }}
|
||||
|
@@ -1,6 +1,12 @@
|
||||
{{- if not .features.shell }}
|
||||
.config/fish
|
||||
.config/starship.toml
|
||||
{{- end }}
|
||||
|
||||
{{- if not .features.git }}
|
||||
.config/git
|
||||
{{- end }}
|
||||
|
||||
{{- if not .features.editor }}
|
||||
.config/nvim
|
||||
{{- end }}
|
||||
|
@@ -24,6 +24,24 @@ trap 'echo -e "\n\033[1;31mError: Script \"$SCRIPT_PATH\" failed at line $LINENO
|
||||
# </init>
|
||||
# <core>
|
||||
|
||||
# Ask for confirmation before running the script
|
||||
while true; do
|
||||
read -p "Do you want to run the setup script? [Y/n]: " -n 1 -r REPLY
|
||||
|
||||
# Clear the input buffer and add a newline
|
||||
while read -t 0.001 TMP; do continue; done
|
||||
echo
|
||||
|
||||
# Convert to lowercase and default to 'y' if empty
|
||||
REPLY=${REPLY:-y}
|
||||
|
||||
case $REPLY in
|
||||
Y|y|1) break ;;
|
||||
N|n|0) exit 0 ;;
|
||||
*) echo "Invalid input. Please enter y or n." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if python3 and python3-venv are installed
|
||||
if ! command -v python3 >/dev/null 2>&1; then
|
||||
echo -e "\e[1;34mpython3 not found. Installing it...\e[0m"
|
||||
|
7
home/private_dot_config/fish/conf.d/aliases.fish.tmpl
Normal file
7
home/private_dot_config/fish/conf.d/aliases.fish.tmpl
Normal file
@@ -0,0 +1,7 @@
|
||||
abbr --add --position command l ls -lAh
|
||||
|
||||
{{- if .features.editor }}
|
||||
# Alias `vi` and `vim` to Neovim
|
||||
abbr --add --position command vim nvim
|
||||
abbr --add --position command vi nvim
|
||||
{{- end }}
|
@@ -0,0 +1,4 @@
|
||||
{{- if .features.editor }}
|
||||
# Set Neovim to be the default editor
|
||||
set --export EDITOR nvim
|
||||
{{- end }}
|
2
home/private_dot_config/fish/conf.d/path.fish.tmpl
Normal file
2
home/private_dot_config/fish/conf.d/path.fish.tmpl
Normal file
@@ -0,0 +1,2 @@
|
||||
# Add `~/.local/bin` to PATH
|
||||
set fish_user_paths {{ joinPath .chezmoi.homeDir ".local/bin" }}
|
5
home/private_dot_config/fish/conf.d/staship.fish
Normal file
5
home/private_dot_config/fish/conf.d/staship.fish
Normal file
@@ -0,0 +1,5 @@
|
||||
# Disable the default Fish greeting message
|
||||
set fish_greeting ""
|
||||
|
||||
# Initialize Starship
|
||||
starship init fish | source
|
@@ -17,3 +17,14 @@ ff = true
|
||||
[credential]
|
||||
helper = {{ $credentialHelperPath }}
|
||||
{{- end }}
|
||||
|
||||
{{- $projectsDir := joinPath .chezmoi.homeDir "Projects" }}
|
||||
{{- if stat $projectsDir }}
|
||||
{{- $projects := output "find" $projectsDir "-type" "f" "-mindepth" "2" "-maxdepth" "2" "-name" ".gitconfig" | trim | splitList "\n" }}
|
||||
{{- range $projects }}
|
||||
{{- if . }}
|
||||
[includeIf "gitdir:{{ . | dir }}/**/"]
|
||||
path = {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
6
home/private_dot_config/nvim/init.lua
Normal file
6
home/private_dot_config/nvim/init.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
-- Enable relative line numbers
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- Highlight the current line
|
||||
vim.opt.cursorline = true
|
@@ -27,3 +27,5 @@
|
||||
when: features.shell == true
|
||||
- role: git
|
||||
when: features.git == true
|
||||
- role: editor
|
||||
when: features.editor == true
|
||||
|
5
setup-script/roles/editor/tasks/main.yaml
Normal file
5
setup-script/roles/editor/tasks/main.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
- name: Install Neovim on Arch
|
||||
become: true
|
||||
ansible.builtin.pacman:
|
||||
name: neovim
|
||||
when: chezmoi.osRelease.id == "arch"
|
@@ -1,7 +1,10 @@
|
||||
- name: Install Fish shell on Arch
|
||||
- name: Install Fish shell and Starship on Arch
|
||||
become: true
|
||||
ansible.builtin.pacman:
|
||||
name: fish
|
||||
name:
|
||||
- fish
|
||||
- starship
|
||||
- ttf-nerd-fonts-symbols # Required for Starship
|
||||
when: chezmoi.osRelease.id == "arch"
|
||||
|
||||
- name: Find Fish shell binary
|
||||
|
Reference in New Issue
Block a user