From 6537ecdcf7ca998107b592b18b2dc11c4644ea74 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 17 Feb 2025 21:25:01 -0500 Subject: [PATCH] init flake stuff --- flake.nix | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ oem/install.bat | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f7410cb --- /dev/null +++ b/flake.nix @@ -0,0 +1,58 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + wfvm.url = "git+https://git.m-labs.hk/m-labs/wfvm"; + }; + + outputs = + { + self, + nixpkgs, + wfvm, + }: + let + pkgs = import nixpkgs; + in + { + packages."x86_64-linux".windows-vm = wfvm.lib.makeWindowsImage { + # configuration parameters go here + windowsImage = pkgs.requireFile { + name = "Tiny11_24H2_English_x64.iso"; + sha256 = "ea9cee512457c763484dbeaeee98caba8c2e69e0420bdae8c4508e31ad8ccd99"; + }; + + installCommands = [ + { + name = "execute oem bat"; + script = + let + oem_bat = ./oem/install.bat; + in + '' + ln -s ${oem_bat} ./oem_bat.bat + win-put oem_bat.bat . + echo Running Oem Bat... + win-exec 'start /wait "" .\oem_bat.bat' + echo Oem Bat finished + ''; + } + { + name = "execute powershell"; + script = + let + powershell_oem = ./oem/powershell-stuff.ps1; + in + '' + ln -s ${powershell_oem} ./oem_ps.ps1 + win-put oem_ps.ps1 . + echo Running Oem PS... + win-exec 'start /wait "" powershell -executionpolicy remotesigned -File .\oem_ps.ps1' + echo Oem powershell finished + ''; + } + + ]; + + }; + }; +} diff --git a/oem/install.bat b/oem/install.bat index bbff87b..99e6301 100644 --- a/oem/install.bat +++ b/oem/install.bat @@ -19,7 +19,7 @@ winget install -e --id Microsoft.VisualStudio.2022.BuildTools --accept-source-ag winget install -e --id Microsoft.VisualStudio.2022.Community --accept-source-agreements --override "--passive --wait --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended" :: powershell stuff -powershell -executionpolicy remotesigned -File C:\OEM\powershell-stuff.ps1 +:: powershell -executionpolicy remotesigned -File C:\OEM\powershell-stuff.ps1 winget install Mozilla.Firefox --accept-source-agreements