diff --git a/.gitignore b/.gitignore index 2f7d4e8..aaaea16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,30 @@ -# Sensitive files - DO NOT COMMIT -# These files may contain passwords, personal data, or secrets -*-personal.json # Personal configuration files -config-personal/ # Personal config directory -config/backup.json # Personal backup configuration -config/restore.json # Personal restore configuration -manifests/ # Backup manifests and reports -backups/ # Local backup artifacts -*.manifest.json # Backup manifest files -*.restore-report.json # Restore report files -*.backup-report.txt # Human-readable backup reports -*.machine.json # Machine-specific exports +# Sensitive files - do not commit +# These files may contain passwords, personal data, or machine-specific values. +*-personal.json +config-personal/ +config/backup.json +config/restore.json +apps.json +optional-apps.json +apps-export.json + +# Backup manifests and reports +manifests/ +backups/ +*.manifest.json +*.restore-report.json +*.backup-report.txt +*.machine.json -# Note: autounattend.xml IS committed (passwords left blank, Windows prompts during install) +# Note: autounattend.xml is committed as a template with blank secrets. # Build outputs build/ output/ dist/ -*.iso # Generated Windows ISOs -*.wim # Windows image files -*.esd # Windows image files +*.iso +*.wim +*.esd # Temporary files temp/ @@ -30,7 +35,7 @@ install.log # Downloaded tools oscdimg.exe -Sophia-Script/ # Downloaded Sophia Script (download fresh each time) +Sophia-Script/ # System files Thumbs.db @@ -41,8 +46,3 @@ desktop.ini *.bak *.backup *~ - -# Personal apps list (keep template, not personal list) -# Your personal app list - don't commit -# Use apps-template.json instead for sharing -apps.json diff --git a/README.md b/README.md index a8f7ecd..1b4f41c 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,9 @@ winget export -o apps.json --source winget **Note:** Only captures apps installed via WinGet. -For personal usage, keep `apps.json` out of git. The repo ships `apps-template.json`, and the backup workflow preserves your personal `apps.json` so it can be restored into the cloned repo after reinstall. +For personal usage, keep `apps.json`, `optional-apps.json`, and `config\backup.json` out of git. The repo ships `apps-template.json`, `optional-apps-template.json`, and `config\backup.template.json`, and the backup workflow preserves your personal files so they can be restored into the cloned repo after reinstall. -If you want a second-stage app list, create `optional-apps.json` alongside `apps.json`. `apps.json` installs automatically during bootstrap, while `optional-apps.json` is offered with a yes/no prompt after first login and can also be installed later from a desktop shortcut. +If you want a second-stage app list, create `optional-apps.json` alongside `apps.json`. Start from `optional-apps-template.json` if you want an example. `apps.json` installs automatically during bootstrap, while `optional-apps.json` is offered with a yes/no prompt after first login and can also be installed later from a desktop shortcut. ### Backup Before Reinstall @@ -90,7 +90,7 @@ This backs up: ### 2. Edit Your App List -Open `apps.json` and remove unwanted apps: +Copy `apps-template.json` to `apps.json`, then remove unwanted apps: ```json { @@ -126,7 +126,7 @@ winget import apps.json --accept-package-agreements --accept-source-agreements Optional apps can use the same manifest format: ```powershell -Copy-Item apps.json optional-apps.json +Copy-Item optional-apps-template.json optional-apps.json # Then edit optional-apps.json for apps you want to install later ``` @@ -176,8 +176,8 @@ declarative-windows/ ├── CLAUDE.md # Project guidance for Claude Code ├── brainstorm.md # Design discussions │ -├── apps.json # Auto-installed WinGet package list -├── optional-apps.json # Prompted/later WinGet package list (optional) +├── apps-template.json # Example auto-installed WinGet package list +├── optional-apps-template.json # Example prompted/later WinGet package list ├── Sophia-Preset.ps1 # Custom Sophia Script configuration ├── autounattend.xml # Windows unattended install config ├── bootstrap.ps1 # Main orchestration script diff --git a/optional-apps-template.json b/optional-apps-template.json new file mode 100644 index 0000000..b3e0508 --- /dev/null +++ b/optional-apps-template.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://aka.ms/winget-packages.schema.2.0.json", + "CreationDate": "2026-03-27T23:43:29.352-00:00", + "Sources": [ + { + "Packages": [ + { + "PackageIdentifier": "JetBrains.Toolbox" + }, + { + "PackageIdentifier": "CPUID.CPU-Z" + }, + { + "PackageIdentifier": "REALiX.HWiNFO" + }, + { + "PackageIdentifier": "FinalWire.AIDA64.Extreme" + }, + { + "PackageIdentifier": "Wagnardsoft.DisplayDriverUninstaller" + }, + { + "PackageIdentifier": "WhirlwindFX.SignalRgb" + } + ], + "SourceDetails": { + "Argument": "https://cdn.winget.microsoft.com/cache", + "Identifier": "Microsoft.Winget.Source_8wekyb3d8bbwe", + "Name": "winget", + "Type": "Microsoft.PreIndexed.Package" + } + } + ], + "WinGetVersion": "1.29.30-preview" +} diff --git a/preflight-backup.ps1 b/preflight-backup.ps1 index e966806..55f8c01 100644 --- a/preflight-backup.ps1 +++ b/preflight-backup.ps1 @@ -247,6 +247,7 @@ function Get-RepoFilesToBackup { $files = @( "apps.json", + "optional-apps.json", "config\backup.json" ) diff --git a/tests/BackupRestore.Tests.ps1 b/tests/BackupRestore.Tests.ps1 index d83dfba..3607a25 100644 --- a/tests/BackupRestore.Tests.ps1 +++ b/tests/BackupRestore.Tests.ps1 @@ -20,6 +20,10 @@ Describe "backup and restore static checks" { $backupScriptContent | Should -Match "restorePath" } + It "backs up optional app manifest when present" { + $backupScriptContent | Should -Match "optional-apps\.json" + } + It "restores in merge mode by default" { $restoreScriptContent | Should -Match 'Merge' }