first windows configuration

This commit is contained in:
Gal Szkolnik 2025-04-26 00:35:40 -04:00
parent 386f3d77d4
commit a5684ded6c
5 changed files with 21 additions and 11 deletions

View File

@ -68,12 +68,12 @@ $local:CZ_ROOT_LINK=(Join-Path $env:CHEZMOI_SOURCE_DIR "$CZROOTLINK")
Write-Host -ForegroundColor Green "System detected as $($env:CHEZMOI_OS)/$($env:CHEZMOI_ARCH), setting up .chezmoiroot and initializing..."
if (Test-Path -PathType Leaf "$CZ_ROOT_LINK.$CZ_SYS.$CZ_CHASSIS") {
$CZ_ROOT_LINK = "$CZ_ROOT_LINK.$CZ_SYS.$CZ_CHASSIS"
} elseif(Test-Path -PathType Leaf "$CZ_ROOT_LINK.$CZ_SYS") {
$CZ_ROOT_LINK = "$CZ_ROOT_LINK.$CZ_SYS"
} elseif(Test-Path -PathType Leaf "$CZ_ROOT_LINK.$CZ_CHASSIS") {
$CZ_ROOT_LINK = "$CZ_ROOT_LINK.$CZ_CHASSIS"
if (Test-Path -PathType Leaf "${CZ_ROOT_LINK}.${CZ_SYS}.${CZ_CHASSIS}") {
$CZ_ROOT_LINK = "${CZ_ROOT_LINK}.${CZ_SYS}.${CZ_CHASSIS}"
} elseif(Test-Path -PathType Leaf "${CZ_ROOT_LINK}.$CZ_SYS") {
$CZ_ROOT_LINK = "${CZ_ROOT_LINK}.${CZ_SYS}"
} elseif(Test-Path -PathType Leaf "${CZ_ROOT_LINK}.${CZ_CHASSIS}") {
$CZ_ROOT_LINK = "${CZ_ROOT_LINK}.${CZ_CHASSIS}"
} else {
Write-Host -ForegroundColor Red "Failed to find a matching .chezmoiroot. Aborting!"
exit 1
@ -84,11 +84,18 @@ $local:newItem = [ordered]@{
Path = $env:CHEZMOI_SOURCE_DIR
Name = ".chezmoiroot"
Value = @((Get-Content -LiteralPath $CZ_ROOT_LINK).Replace('\', '/')) -join "`n"
Value = (Get-Content -LiteralPath $CZ_ROOT_LINK).Replace('\', '/')
}
$null = New-Item @newItem -ErrorAction Stop
Remove-Item ~/.config/chezmoi/chezmoistate.boltdb
Write-Host -ForegroundColor Green ".chezmoiroot initialized. You will need to run chezmoi init --apply again (the command is already in your clipboard)."
"chezmoi init --apply" | Set-Clipboard
Write-Host -ForegroundColor Green (
".chezmoiroot initialized. You will need to remove:",
" ~/.config/chezmoi/chezmoistate.boltdb",
"and then",
" run chezmoi init --apply again",
"(the commands are already in your clipboard)." -join "`n"
)
"Remove-Item ~/.config/chezmoi/chezmoistate.boltdb; chezmoi init --apply" | Set-Clipboard
{{ end }}

View File

@ -1 +1 @@
_home.windows
chezmoi.roots/_home.windows

View File

@ -0,0 +1,3 @@
{{- output "chezmoi" "execute-template" "-f" (
list .chezmoi.sourceDir "../_src.all/private_dot_config/wezterm/wezterm.lua.tmpl" | join "/"
) -}}

View File

@ -11,7 +11,7 @@ if wezterm.config_builder then
config = wezterm.config_builder()
end
{{- if eq .chezmoi.os "Windows" }}
{{- if eq .chezmoi.os "windows" }}
config.default_prog = { 'pwsh' }
{{- end }}