-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfiguration.dsc.yaml
More file actions
491 lines (491 loc) · 20.2 KB
/
configuration.dsc.yaml
File metadata and controls
491 lines (491 loc) · 20.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
#
# To run: winget configure ./configuration.dsc.yaml --accept-configuration-agreements
#
# NOTE: `allowPrerelease: true` is required as DSC is still in preview.
properties:
configurationVersion: 0.2.0
assertions:
- resource: Microsoft.Windows.Developer/OsVersion
directives:
description: Verify minimum OS version requirement
allowPrerelease: true
settings:
MinVersion: '10.0.22000'
resources:
- resource: Microsoft.Windows.Developer/DeveloperMode
directives:
description: Enable Developer Mode
allowPrerelease: true
settings:
Ensure: Present
- resource: Microsoft.Windows.Developer/EnableLongPathSupport
directives:
description: Enable long path support
allowPrerelease: true
settings:
Ensure: Present
- resource: PSDscResources/Script
directives:
# Scoop isn't in winget, so install via its official installer
# (https://scoop.sh). Buckets beyond the default `main` are not declared
# here -- add a follow-up Script if you need extras/versions/etc.
description: Install scoop (user-scope package manager)
allowPrerelease: true
settings:
GetScript: |
$bin = Join-Path $env:USERPROFILE 'scoop\shims\scoop.ps1'
@{ Result = if (Test-Path -LiteralPath $bin) { 'present' } else { 'absent' } }
TestScript: |
$bin = Join-Path $env:USERPROFILE 'scoop\shims\scoop.ps1'
Test-Path -LiteralPath $bin
SetScript: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
Invoke-Expression "& {$(Invoke-RestMethod get.scoop.sh)}"
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install PowerShell 7
settings:
id: Microsoft.PowerShell
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install NVM for Windows
settings:
id: CoreyButler.NVMforWindows
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Neovim
settings:
id: Neovim.Neovim
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Glow (Markdown renderer)
settings:
id: charmbracelet.glow
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install PowerToys x64
allowPrerelease: true
settings:
id: Microsoft.PowerToys
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install vswhere
allowPrerelease: true
settings:
id: Microsoft.VisualStudio.Locator
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Oh My Posh
allowPrerelease: true
settings:
id: JanDeDobbeleer.OhMyPosh
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Git
allowPrerelease: true
settings:
id: Git.Git
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install GitHub CLI
allowPrerelease: true
settings:
id: GitHub.cli
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install GitHub Copilot CLI
allowPrerelease: true
settings:
id: GitHub.Copilot
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: install-jq
directives:
description: Install jq
allowPrerelease: true
settings:
id: jqlang.jq
source: winget
- resource: PSDscResources/Script
dependsOn:
- install-jq
directives:
# Deep-merge the repo's copilot/settings.json into ~/.copilot/settings.json
# so existing on-disk settings (e.g., per-machine tweaks) are preserved.
# Test returns false so the merge runs every winget configure — cheap,
# and the source can change between runs.
description: Merge Copilot user settings into ~/.copilot/settings.json
allowPrerelease: true
settings:
GetScript: |
$t = Join-Path $env:USERPROFILE '.copilot\settings.json'
@{ Result = if (Test-Path -LiteralPath $t) { 'present' } else { 'absent' } }
TestScript: |
$false
SetScript: |
$env:Path = [System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')
$t = Join-Path $env:USERPROFILE '.copilot\settings.json'
$null = New-Item -ItemType Directory -Force -Path (Split-Path $t)
if (-not (Test-Path -LiteralPath $t)) { '{}' | Set-Content -LiteralPath $t }
$src = Join-Path '${WinGetConfigRoot}' 'copilot\settings.json'
$merged = jq -s '.[0] * .[1]' $t $src
if ($LASTEXITCODE -ne 0) { throw "jq merge of $src into $t failed with exit code $LASTEXITCODE" }
$merged | Set-Content -LiteralPath $t
- resource: PSDscResources/Script
dependsOn:
- install-jq
directives:
# Same deep-merge pattern as the settings merge above; preserves
# per-machine MCP servers while applying repo-managed updates.
description: Merge MCP server config into ~/.copilot/mcp-config.json
allowPrerelease: true
settings:
GetScript: |
$t = Join-Path $env:USERPROFILE '.copilot\mcp-config.json'
@{ Result = if (Test-Path -LiteralPath $t) { 'present' } else { 'absent' } }
TestScript: |
$false
SetScript: |
$env:Path = [System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')
$t = Join-Path $env:USERPROFILE '.copilot\mcp-config.json'
$null = New-Item -ItemType Directory -Force -Path (Split-Path $t)
if (-not (Test-Path -LiteralPath $t)) { '{}' | Set-Content -LiteralPath $t }
$src = Join-Path '${WinGetConfigRoot}' 'copilot\mcp-config.json'
$merged = jq -s '.[0] * .[1]' $t $src
if ($LASTEXITCODE -ne 0) { throw "jq merge of $src into $t failed with exit code $LASTEXITCODE" }
$merged | Set-Content -LiteralPath $t
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Microsoft Visual Studio Code (User)
allowPrerelease: true
settings:
id: Microsoft.VisualStudioCode
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install delta
allowPrerelease: true
settings:
id: dandavison.delta
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install less
allowPrerelease: true
settings:
id: jftuga.less
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install lazygit
allowPrerelease: true
settings:
id: JesseDuffield.lazygit
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install zoxide
allowPrerelease: true
settings:
id: ajeetdsouza.zoxide
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install fzf
allowPrerelease: true
settings:
id: junegunn.fzf
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install eza
allowPrerelease: true
settings:
id: eza-community.eza
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install fd
allowPrerelease: true
settings:
id: sharkdp.fd
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: install-bat
directives:
description: Install bat
allowPrerelease: true
settings:
id: sharkdp.bat
source: winget
- resource: PSDscResources/Script
dependsOn:
- install-bat
directives:
# Sentinel-based: delete ~/.config/bat/.dsc-cache-built to force a rebuild
# after adding custom themes or syntaxes under ~/.config/bat
description: Rebuild bat syntax and theme cache
allowPrerelease: true
settings:
GetScript: |
$sentinel = Join-Path $env:USERPROFILE '.config\bat\.dsc-cache-built'
@{ Result = if (Test-Path $sentinel) { 'present' } else { 'absent' } }
TestScript: |
$sentinel = Join-Path $env:USERPROFILE '.config\bat\.dsc-cache-built'
Test-Path $sentinel
SetScript: |
$env:Path = [System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')
bat cache --build
if ($LASTEXITCODE -ne 0) { throw "bat cache --build failed with exit code $LASTEXITCODE" }
$cacheDir = Join-Path $env:USERPROFILE '.config\bat'
$null = New-Item -ItemType Directory -Force -Path $cacheDir
$sentinel = Join-Path $cacheDir '.dsc-cache-built'
$null = New-Item -ItemType File -Force -Path $sentinel
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install yt-dlp
allowPrerelease: true
settings:
id: yt-dlp.yt-dlp
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install DevToys
allowPrerelease: true
settings:
id: '9PGCV4V3BK4W'
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: install-komorebi
directives:
description: Install komorebi
allowPrerelease: true
settings:
id: LGUG2Z.komorebi
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Windows Hotkey Daemon (whkd)
allowPrerelease: true
settings:
id: LGUG2Z.whkd
source: winget
- resource: PSDscResources/Script
id: install-psmux
dependsOn:
- install-rustup
directives:
# psmux from MattKotsenas/psmux (fork) instead of marlocarlo.psmux (winget)
# to pick up a copy/paste fix being upstreamed. master is the integration
# branch with all in-flight fixes already merged. cargo install is a no-op
# when the git rev hasn't moved, so re-running on every winget configure
# is cheap. When the fix lands upstream, revert to:
# - resource: Microsoft.WinGet.DSC/WinGetPackage
# id: install-psmux
# settings: { id: marlocarlo.psmux, source: winget }
description: Install psmux from fork (master = all in-flight fixes merged)
allowPrerelease: true
settings:
GetScript: |
$cargoBin = if ($env:CARGO_HOME) { Join-Path $env:CARGO_HOME 'bin' } else { Join-Path $env:USERPROFILE '.cargo\bin' }
$bin = Join-Path $cargoBin 'psmux.exe'
@{ Result = if (Test-Path -LiteralPath $bin) { 'present' } else { 'absent' } }
TestScript: |
$false
SetScript: |
$env:Path = [System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')
cargo install --git https://github.com/MattKotsenas/psmux.git psmux 2>&1 | Out-Host
if ($LASTEXITCODE -ne 0) { throw "cargo install --git psmux failed with exit code $LASTEXITCODE" }
- resource: PSDscResources/Script
dependsOn:
- install-psmux
directives:
# Bootstrap PPM (psmux's plugin manager) by cloning the fork and copying
# its ppm/ subdir to ~/.psmux/plugins/ppm. install_plugins.ps1 then reads
# ~/.psmux.conf and installs the @plugin entries declared there.
# Test dot-sources ppm.ps1 to reuse PPM's own spec parser, so subsequent
# runs report "in desired state" once every declared plugin is on disk.
# Soft dependency on Get-DeclaredPlugins/Resolve-PluginSpec function
# names in the fork's ppm.ps1; revisit if PPM is restructured upstream.
description: Bootstrap PPM and install psmux plugins from .psmux.conf
allowPrerelease: true
settings:
GetScript: |
$ppm = Join-Path $env:USERPROFILE '.psmux\plugins\ppm\ppm.ps1'
@{ Result = if (Test-Path -LiteralPath $ppm) { 'present' } else { 'absent' } }
TestScript: |
$ppm = Join-Path $env:USERPROFILE '.psmux\plugins\ppm\ppm.ps1'
if (-not (Test-Path -LiteralPath $ppm)) { return $false }
. $ppm
$declared = Get-DeclaredPlugins
foreach ($spec in $declared) {
$info = Resolve-PluginSpec $spec
if (-not (Test-Path -LiteralPath $info.Path)) { return $false }
}
return $true
SetScript: |
$env:Path = [System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')
$ppmDest = Join-Path $env:USERPROFILE '.psmux\plugins\ppm'
$tmpDir = Join-Path $env:TEMP 'psmux-plugins'
if (Test-Path $tmpDir) { Remove-Item $tmpDir -Recurse -Force }
git clone --depth 1 https://github.com/MattKotsenas/psmux-plugins.git $tmpDir 2>&1 | Out-Host
$null = New-Item $ppmDest -ItemType Directory -Force
Copy-Item (Join-Path $tmpDir 'ppm\*') $ppmDest -Recurse -Force
Remove-Item $tmpDir -Recurse -Force
& (Join-Path $ppmDest 'scripts\install_plugins.ps1') 2>&1 | Out-Host
if ($LASTEXITCODE -ne 0) { throw "install_plugins.ps1 failed with exit code $LASTEXITCODE" }
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: install-uv
directives:
description: Install uv (Python package manager)
allowPrerelease: true
settings:
id: astral-sh.uv
source: winget
- resource: PSDscResources/Script
id: install-uv-python
dependsOn:
- install-uv
directives:
# uv manages Python; --default also drops python/python3 shims into
# ~/.local/bin so a bare `python` works without a separate runtime.
description: Install uv-managed Python with --default shims
allowPrerelease: true
settings:
GetScript: |
$py = Join-Path $env:USERPROFILE '.local\bin\python.exe'
@{ Result = if (Test-Path -LiteralPath $py) { 'present' } else { 'absent' } }
TestScript: |
$py = Join-Path $env:USERPROFILE '.local\bin\python.exe'
Test-Path -LiteralPath $py
SetScript: |
$env:Path = [System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')
uv python install --default --preview-features python-install-default 3.13 2>&1 | Out-Host
if ($LASTEXITCODE -ne 0) { throw "uv python install failed with exit code $LASTEXITCODE" }
- resource: PowerShellGet/PSModule
directives:
description: Install posh-git from PSGallery (git tab completion + status)
allowPrerelease: true
settings:
Name: posh-git
Repository: PSGallery
Ensure: Present
InstallationPolicy: Trusted
- resource: PowerShellGet/PSModule
directives:
description: Install PSFzf from PSGallery (fzf-powered tab completion)
allowPrerelease: true
settings:
Name: PSFzf
Repository: PSGallery
Ensure: Present
InstallationPolicy: Trusted
- resource: PSDscResources/Script
dependsOn:
- install-uv-python
directives:
# Disable the Microsoft Store Python app-execution aliases so `python`
# resolves to the uv-managed shim in ~/.local/bin instead of the Store
# stub. Versioned aliases (python3.13.exe, pythonw3.13.exe) are left
# alone. Matches what the Settings UI does internally (file deletion).
# When https://github.com/microsoft/winget-dsc/pull/146 lands and ships
# an official Microsoft.Windows.Setting.Apps/AppExecutionAliases
# resource, replace this Script with that resource.
description: Disable Microsoft Store Python app-execution aliases
allowPrerelease: true
settings:
GetScript: |
$apps = Join-Path $env:LOCALAPPDATA 'Microsoft\WindowsApps'
$stubs = @('python.exe','python3.exe','pythonw.exe','pythonw3.exe')
$active = @($stubs | Where-Object { Test-Path -LiteralPath (Join-Path $apps $_) })
@{ Result = if ($active.Count -eq 0) { 'all disabled' } else { "active: $($active -join ',')" } }
TestScript: |
$apps = Join-Path $env:LOCALAPPDATA 'Microsoft\WindowsApps'
$stubs = @('python.exe','python3.exe','pythonw.exe','pythonw3.exe')
$active = @($stubs | Where-Object { Test-Path -LiteralPath (Join-Path $apps $_) })
$active.Count -eq 0
SetScript: |
$apps = Join-Path $env:LOCALAPPDATA 'Microsoft\WindowsApps'
$stubs = @('python.exe','python3.exe','pythonw.exe','pythonw3.exe')
foreach ($n in $stubs) {
$src = Join-Path $apps $n
if (Test-Path -LiteralPath $src) {
Remove-Item -LiteralPath $src -Force
}
}
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: install-rustup
directives:
description: Install Rust (via rustup)
allowPrerelease: true
settings:
id: Rustlang.Rustup
source: winget
- resource: RustDsc/CargoToolInstall
dependsOn:
- install-rustup
directives:
description: Install pay-respects
allowPrerelease: true
settings:
CrateName: pay-respects
- resource: RustDsc/CargoToolInstall
dependsOn:
- install-rustup
directives:
description: Install pay-respects-module-runtime-rules
allowPrerelease: true
settings:
CrateName: pay-respects-module-runtime-rules
- resource: RustDsc/CargoToolInstall
dependsOn:
- install-rustup
directives:
description: Install tuicr
allowPrerelease: true
settings:
CrateName: tuicr
- resource: PSDscResources/Script
dependsOn:
- install-rustup
directives:
# wpm has no crates.io publish and no GitHub releases (its license also
# forbids third-party packaging), so cargo install --git is the only
# supported path. RustDsc/CargoToolInstall doesn't yet support --git,
# so this stays a Script. Test always returns $false to keep the
# dogfood-HEAD intent — cargo itself is a no-op when the git rev hasn't
# moved, so re-running on every winget configure is cheap.
description: Install wpm from git master (dogfood HEAD; crates.io lags behind)
allowPrerelease: true
settings:
GetScript: |
$cargoBin = if ($env:CARGO_HOME) { Join-Path $env:CARGO_HOME 'bin' } else { Join-Path $env:USERPROFILE '.cargo\bin' }
$bin = Join-Path $cargoBin 'wpmctl.exe'
@{ Result = if (Test-Path -LiteralPath $bin) { 'present' } else { 'absent' } }
TestScript: |
$false
SetScript: |
$env:Path = [System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')
cargo install --git https://github.com/LGUG2Z/wpm.git wpmctl wpmd 2>&1 | Out-Host
if ($LASTEXITCODE -ne 0) { throw "cargo install --git wpm failed with exit code $LASTEXITCODE" }
- resource: PSDscResources/Registry
directives:
description: Enable UTF-8 for worldwide language support (Beta)
allowPrerelease: true
settings:
Key: HKLM:\SYSTEM\CurrentControlSet\Control\Nls\CodePage
ValueName: ACP
ValueData: ['65001']
ValueType: String
Force: true
Ensure: Present