-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(win_setup, pwsh): Adding windows setup scripts into .local and r…
…efactoring pwsh profile functions.
- Loading branch information
1 parent
b65cd83
commit 325de1f
Showing
5 changed files
with
132 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{{- if ne .chezmoi.os "windows" }} | ||
Documents | ||
windows_setup | ||
workspacer | ||
wezterm | ||
{{- end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
home/dot_local/windows_setup/Install-WindowsSetup.ps1.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
."..\..\Documents\PowerShell\Functions.ps1" | ||
|
||
# Install Scoop packages | ||
# NOTE: Scoop is the primary package manager for my environment | ||
|
||
irm get.scoop.sh | iex | ||
if (-Not (Get-Command git -ErrorAction SilentlyContinue)){ | ||
scoop install main/git # Git is required to install other buckets | ||
} | ||
|
||
{{range .scoop.buckets -}} | ||
scoop bucket add {{. | quote}} | ||
{{- end}} | ||
|
||
scoop install @( | ||
{{range .scoop.packages}}{{. | quote}} | ||
{{end -}} | ||
) | ||
|
||
if (-Not (Get-Command winget -ErrorAction SilentlyContinue)){ | ||
scoop install main/winget | ||
} | ||
|
||
# Install Winget packages | ||
|
||
winget install @( | ||
{{range .winget.packages}}{{. | quote}} | ||
{{end -}} | ||
"--accept-source-agreements" | ||
"--accept-package-agreements" | ||
"--silent" | ||
"--disable-interactivity" | ||
) | ||
|
||
# Set up configuration | ||
|
||
.\Add-ContextMenuDir.ps1 @{ | ||
DisplayName = "WezTerm" | ||
ApplicationPath = "$(scoop prefix wezterm)\wezterm-gui.exe" | ||
ApplicationArgs = 'start --no-auto-connect --cwd "%V"' | ||
} | ||
|
||
nvm install lts | ||
nvm on | ||
Invoke-Expression "$(scoop prefix nvm)\nodejs\nodejs\npm install -g neovim" | ||
|
||
conda init powershell | ||
conda install -y -c conda-forge pynvim | ||
|
||
git config --global credential.helper manager |
30 changes: 30 additions & 0 deletions
30
home/dot_local/windows_setup/Uninstall-WindowsSetup.ps1.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
."..\..\Documents\PowerShell\Functions.ps1" | ||
|
||
# Cleaning up configuration | ||
|
||
Remove-ContextMenuDir.ps1 -DisplayName "WezTerm" | ||
|
||
$Targets = @(chezmoi managed --include files --path-style absolute) | ||
foreach ($Target in $Targets) { | ||
Remove-Item -Path $Target | ||
} | ||
chezmoi purge | ||
|
||
# Cleaning up installations | ||
# NOTE: Only Scoop, Git, and Winget remains | ||
|
||
winget uninstall @( | ||
{{range .winget.packages}}{{. | quote}} | ||
{{end -}} | ||
"--purge" | ||
"--accept-source-agreements" | ||
"--accept-package-agreements" | ||
"--silent" | ||
"--disable-interactivity" | ||
) | ||
|
||
scoop uninstall @( | ||
{{range .scoop.packages}}{{. | quote}} | ||
{{end -}} | ||
"--purge" | ||
) |