Skip to content

Commit b0c601f

Browse files
committedSep 21, 2024
add zsh to packer, add ubu
1 parent 2808793 commit b0c601f

File tree

3 files changed

+39
-11
lines changed

3 files changed

+39
-11
lines changed
 

‎packer/ubuntu-jammy/files/.zshrc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Path to your Oh My Zsh installation.
2+
export ZSH="$HOME/.oh-my-zsh"
3+
export PATH=$PATH:$HOME/.local/bin
4+
5+
# Set theme
6+
ZSH_THEME="robbyrussell"
7+
8+
# Plugins
9+
plugins=(git ubuntu copypath copyfile dirhistory zsh-interactive-cd docker docker-compose opentofu zsh-history-substring-search zsh-autosuggestions zsh-syntax-highlighting you-should-use)
10+
11+
source $ZSH/oh-my-zsh.sh
12+
13+
# Set up Oh My Posh
14+
eval "$(oh-my-posh init zsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/sonicboom_dark.omp.json)"
15+
16+
# Custom aliases
17+
alias dcd="docker compose down"
18+
alias dcu="docker compose up -d"
19+
20+
# Display system information
21+
neofetch

‎packer/ubuntu-jammy/ubuntu-jammy.pkr.hcl

+18-7
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,38 @@ build {
9494
]
9595
}
9696

97-
9897
provisioner "file" {
9998
source = "files/pve.cfg"
10099
destination = "/tmp/pve.cfg"
101100
}
102101

103-
104102
provisioner "shell" {
105103
inline = [ "sudo cp /tmp/pve.cfg /etc/cloud/cloud.cfg.d/pve.cfg" ]
106104
}
107105

108-
# Install Commonly Used Things - add alias's - set git config
106+
# Install commonly used things - add alias's - set git config
109107
provisioner "shell" {
110108
inline = [
111-
"sudo apt-get install -y ca-certificates curl gnupg lsb-release nfs-common qemu-guest-agent net-tools",
109+
"sudo apt-get install -y ca-certificates curl gnupg lsb-release nfs-common qemu-guest-agent net-tools zsh neofetch fzf",
110+
"sudo chsh -s $(which zsh) mafyuh",
112111
"curl -fsSL https://get.docker.com | sudo sh",
113-
"echo \"alias dcu='docker compose up -d'\" >> ~/.bashrc",
114-
"echo \"alias dcd='docker compose down'\" >> ~/.bashrc",
112+
"sh -c \"$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\" --unattended",
113+
"git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting",
114+
"git clone https://github.com/zsh-users/zsh-autosuggestions.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions",
115+
"git clone https://github.com/zsh-users/zsh-history-substring-search.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-history-substring-search",
116+
"git clone https://github.com/MichaelAquilina/zsh-you-should-use.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/you-should-use",
117+
"mkdir -p /home/mafyuh/.local/bin",
118+
"curl -fsSL https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -o /home/mafyuh/.local/bin/oh-my-posh",
119+
"sudo chmod +x /home/mafyuh/.local/bin/oh-my-posh",
115120
"git config --global user.name \"Mafyuh\"",
116121
"git config --global user.email \"matt@mafyuh.com\"",
117122
"sudo apt-get -y update"
118123
]
119124
}
120-
}
125+
126+
provisioner "file" {
127+
source = "files/.zshrc"
128+
destination = "~/.zshrc"
129+
}
130+
131+
}

‎terraform/ubu.tf

-4
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,4 @@ resource "proxmox_virtual_environment_vm" "Ubu" {
6464
]
6565
}
6666

67-
}
68-
69-
output "vm_ipv4_address" {
70-
value = proxmox_virtual_environment_vm.Ubu.ipv4_addresses[1][0]
7167
}

0 commit comments

Comments
 (0)
Please sign in to comment.