From e071bcdc88faf8e3d10f1686691783ca7831d596 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 8 Sep 2024 17:47:28 +0200 Subject: [PATCH] Use same installer script for all profiles --- profiles/machines/manuel/DerGeret/Windows/Setup.ps1 | 1 - profiles/machines/manuel/Generic/Windows/Setup.ps1 | 1 - profiles/machines/manuel/KVM/Windows/Setup.ps1 | 2 -- scripts/Windows/OS/Install.ps1 | 3 +++ scripts/Windows/OS/Setup.ps1 | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 scripts/Windows/OS/Install.ps1 diff --git a/profiles/machines/manuel/DerGeret/Windows/Setup.ps1 b/profiles/machines/manuel/DerGeret/Windows/Setup.ps1 index 5b16249e..56e7d85e 100644 --- a/profiles/machines/manuel/DerGeret/Windows/Setup.ps1 +++ b/profiles/machines/manuel/DerGeret/Windows/Setup.ps1 @@ -1,6 +1,5 @@ #!/bin/pwsh $env:WIN_COMPUTER_NAME = "DerGeret"; -$env:SETUP_SCRIPT_NAME = "$PSScriptRoot/Restore.ps1"; $env:CONFIG_NAME = $env:WIN_COMPUTER_NAME; . "$PSScriptRoot/../../../../../scripts/Windows/OS/Setup.ps1"; diff --git a/profiles/machines/manuel/Generic/Windows/Setup.ps1 b/profiles/machines/manuel/Generic/Windows/Setup.ps1 index 4ac74507..eaf220f0 100644 --- a/profiles/machines/manuel/Generic/Windows/Setup.ps1 +++ b/profiles/machines/manuel/Generic/Windows/Setup.ps1 @@ -1,6 +1,5 @@ #!/bin/pwsh $env:WIN_COMPUTER_NAME ??= "win11"; -$env:SETUP_SCRIPT_NAME ??= "$PSScriptRoot/Install.ps1"; $env:CONFIG_MODULE ??= "$PSScriptRoot/../config.nix"; . "$PSScriptRoot/../../../../../scripts/Windows/OS/Setup.ps1"; diff --git a/profiles/machines/manuel/KVM/Windows/Setup.ps1 b/profiles/machines/manuel/KVM/Windows/Setup.ps1 index 0dc49f6f..fac997bd 100644 --- a/profiles/machines/manuel/KVM/Windows/Setup.ps1 +++ b/profiles/machines/manuel/KVM/Windows/Setup.ps1 @@ -1,4 +1,2 @@ #!/bin/pwsh -$env:SETUP_SCRIPT_NAME ??= "$PSScriptRoot/Install.ps1"; - . "$PSScriptRoot/../../../../Generic/Windows/Setup.ps1"; diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 new file mode 100644 index 00000000..ec104a17 --- /dev/null +++ b/scripts/Windows/OS/Install.ps1 @@ -0,0 +1,3 @@ +#!/bin/pwsh +. "$PSScriptRoot/Manage.ps1"; +Start-WindowsInstallation; diff --git a/scripts/Windows/OS/Setup.ps1 b/scripts/Windows/OS/Setup.ps1 index acd9607f..ef621e56 100644 --- a/scripts/Windows/OS/Setup.ps1 +++ b/scripts/Windows/OS/Setup.ps1 @@ -8,7 +8,7 @@ function Start-Setup { $Global:ErrorActionPreference = "Inquire"; $env:CONFIG_NAME ??= $ConfigurationName; $null = $env:WIN_COMPUTER_NAME; - $null = $env:SETUP_SCRIPT_NAME; + $null = $env:SETUP_SCRIPT_NAME ??= "$PSScriptRoot/Install.ps1"; $env:WSLENV = "CONFIG_NAME"; $valhallaConfig = ConvertFrom-Json (Get-Content "$PSScriptRoot/../../../.config/$env:CONFIG_NAME.json");