initial nix flake rewrite
This commit is contained in:
61
flake.nix
Normal file
61
flake.nix
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
wfvm.url = "git+https://git.m-labs.hk/m-labs/wfvm";
|
||||
|
||||
# wfvm uses a very old branch of nixpkgs (2023-05-25)
|
||||
wfvm.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
wfvm,
|
||||
}:
|
||||
let
|
||||
# import nixpkgs
|
||||
pkgs = (import nixpkgs {});
|
||||
in
|
||||
{
|
||||
packages."${pkgs.system}".windows-vm = wfvm.lib.makeWindowsImage {
|
||||
windowsImage = (pkgs.fetchurl {
|
||||
url = "file:///home/primary/Downloads/tiny11.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
|
||||
'';
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user