diff --git a/.chezmoiscripts/run_init.ps1.tmpl b/.chezmoiscripts/run_init.ps1.tmpl index 3bfb5b2..71ff329 100644 --- a/.chezmoiscripts/run_init.ps1.tmpl +++ b/.chezmoiscripts/run_init.ps1.tmpl @@ -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 }} \ No newline at end of file diff --git a/chezmoi.roots/__root_links/base.chezmoiroot.windows b/chezmoi.roots/__root_links/base.chezmoiroot.windows index 4e2346c..3fa4c0c 100644 --- a/chezmoi.roots/__root_links/base.chezmoiroot.windows +++ b/chezmoi.roots/__root_links/base.chezmoiroot.windows @@ -1 +1 @@ -_home.windows \ No newline at end of file +chezmoi.roots/_home.windows \ No newline at end of file diff --git a/chezmoi.roots/_home.windows/.chezmoi.toml.tmpl b/chezmoi.roots/_home.windows/.chezmoi.toml.tmpl new file mode 100644 index 0000000..e69de29 diff --git a/chezmoi.roots/_home.windows/private_dot_config/wezterm/wezterm.lua.tmpl b/chezmoi.roots/_home.windows/private_dot_config/wezterm/wezterm.lua.tmpl new file mode 100644 index 0000000..1cb9d26 --- /dev/null +++ b/chezmoi.roots/_home.windows/private_dot_config/wezterm/wezterm.lua.tmpl @@ -0,0 +1,3 @@ +{{- output "chezmoi" "execute-template" "-f" ( + list .chezmoi.sourceDir "../_src.all/private_dot_config/wezterm/wezterm.lua.tmpl" | join "/" +) -}} \ No newline at end of file diff --git a/chezmoi.roots/_src.all/private_dot_config/wezterm/wezterm.lua.tmpl b/chezmoi.roots/_src.all/private_dot_config/wezterm/wezterm.lua.tmpl index 0bba251..4a26c95 100644 --- a/chezmoi.roots/_src.all/private_dot_config/wezterm/wezterm.lua.tmpl +++ b/chezmoi.roots/_src.all/private_dot_config/wezterm/wezterm.lua.tmpl @@ -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 }}