forked from M-Labs/wfvm
Compare commits
No commits in common. "53de3429e335ea4253d04e53b39d3a36de2b7759" and "94ca43da4bc621a95401a57db4b3aaf2abd0f176" have entirely different histories.
53de3429e3
...
94ca43da4b
18
flake.nix
18
flake.nix
|
@ -10,10 +10,18 @@
|
||||||
# layers
|
# layers
|
||||||
layers = (import wfvm/layers { inherit pkgs; }); # end of layers
|
layers = (import wfvm/layers { inherit pkgs; }); # end of layers
|
||||||
|
|
||||||
|
# bundle
|
||||||
|
bundleInstaller = pkgs.runCommandNoCC "win-bundle-installer.exe" {} ''
|
||||||
|
mkdir bundle
|
||||||
|
cd bundle
|
||||||
|
cp ${wfvm/bundle/go.mod} go.mod
|
||||||
|
cp ${wfvm/bundle/main.go} main.go
|
||||||
|
env HOME=$(mktemp -d) GOOS=windows GOARCH=amd64 ${pkgs.go}/bin/go build
|
||||||
|
mv bundle.exe $out
|
||||||
|
'';
|
||||||
|
|
||||||
# makeWindowsImage
|
# makeWindowsImage
|
||||||
makeWindowsImage = attrs: import wfvm/win.nix ({ inherit pkgs; } // attrs );
|
makeWindowsImage = attrs: import wfvm/win.nix ({ inherit pkgs bundleInstaller; } // attrs );
|
||||||
|
|
||||||
build-demo-image = { impureMode ? false }: makeWindowsImage {
|
build-demo-image = { impureMode ? false }: makeWindowsImage {
|
||||||
# Build install script & skip building iso
|
# Build install script & skip building iso
|
||||||
|
@ -51,7 +59,7 @@
|
||||||
# administratorPassword = "12345";
|
# administratorPassword = "12345";
|
||||||
|
|
||||||
# Imperative installation commands, to be installed incrementally
|
# Imperative installation commands, to be installed incrementally
|
||||||
installCommands = if impureMode then [] else (with layers; [
|
installCommands = pkgs.lib.optional (!impureMode) (with layers; [
|
||||||
(collapseLayers [
|
(collapseLayers [
|
||||||
disable-autosleep
|
disable-autosleep
|
||||||
disable-autolock
|
disable-autolock
|
||||||
|
@ -70,7 +78,7 @@
|
||||||
|
|
||||||
# License key (required)
|
# License key (required)
|
||||||
# productKey = throw "Search the f* web"
|
# productKey = throw "Search the f* web"
|
||||||
# imageSelection = "1";
|
imageSelection = "Windows 10 Pro";
|
||||||
|
|
||||||
# Locales
|
# Locales
|
||||||
# uiLanguage = "en-US";
|
# uiLanguage = "en-US";
|
||||||
|
@ -107,7 +115,7 @@
|
||||||
|
|
||||||
packages.x86_64-linux = {
|
packages.x86_64-linux = {
|
||||||
demo-image = build-demo-image {};
|
demo-image = build-demo-image {};
|
||||||
demo-image-impure = build-demo-image { impureMode = true; };
|
demo-image-impure = makeWindowsImage { impureMode = true; };
|
||||||
|
|
||||||
make-msys-packages = utils.wfvm-run {
|
make-msys-packages = utils.wfvm-run {
|
||||||
name = "get-msys-packages";
|
name = "get-msys-packages";
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
, impureShellCommands ? []
|
, impureShellCommands ? []
|
||||||
, driveLetter ? "D:"
|
, driveLetter ? "D:"
|
||||||
, efi ? true
|
, efi ? true
|
||||||
, imageSelection ? "1"
|
, imageSelection ? "Windows 10 Pro"
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ let
|
||||||
</InstallTo>
|
</InstallTo>
|
||||||
<InstallFrom>
|
<InstallFrom>
|
||||||
<MetaData wcm:action="add">
|
<MetaData wcm:action="add">
|
||||||
<Key>/IMAGE/INDEX</Key>
|
<Key>/IMAGE/NAME</Key>
|
||||||
<Value>${imageSelection}</Value>
|
<Value>${imageSelection}</Value>
|
||||||
</MetaData>
|
</MetaData>
|
||||||
</InstallFrom>
|
</InstallFrom>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
makeWindowsImage = attrs: import ./win.nix ({ inherit pkgs; } // attrs);
|
||||||
|
layers = (import ./layers { inherit pkgs; });
|
||||||
|
utils = (import ./utils.nix { inherit pkgs; });
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
{ pkgs ? import <nixpkgs> {}, impureMode ? false }:
|
||||||
|
|
||||||
|
let
|
||||||
|
wfvm = (import ./default.nix { inherit pkgs; });
|
||||||
|
in
|
||||||
|
wfvm.makeWindowsImage {
|
||||||
|
# Build install script & skip building iso
|
||||||
|
inherit impureMode;
|
||||||
|
|
||||||
|
# Custom base iso
|
||||||
|
# windowsImage = pkgs.requireFile rec {
|
||||||
|
# name = "Win10_21H1_English_x64.iso";
|
||||||
|
# sha256 = "1sl51lnx4r6ckh5fii7m2hi15zh8fh7cf7rjgjq9kacg8hwyh4b9";
|
||||||
|
# message = "Get ${name} from https://www.microsoft.com/en-us/software-download/windows10ISO";
|
||||||
|
# };
|
||||||
|
|
||||||
|
# impureShellCommands = [
|
||||||
|
# "powershell.exe echo Hello"
|
||||||
|
# ];
|
||||||
|
|
||||||
|
# User accounts
|
||||||
|
# users = {
|
||||||
|
# artiq = {
|
||||||
|
# password = "1234";
|
||||||
|
# # description = "Default user";
|
||||||
|
# # displayName = "Display name";
|
||||||
|
# groups = [
|
||||||
|
# "Administrators"
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Auto login
|
||||||
|
# defaultUser = "artiq";
|
||||||
|
|
||||||
|
# fullName = "M-Labs";
|
||||||
|
# organization = "m-labs";
|
||||||
|
# administratorPassword = "12345";
|
||||||
|
|
||||||
|
# Imperative installation commands, to be installed incrementally
|
||||||
|
installCommands =
|
||||||
|
if impureMode
|
||||||
|
then []
|
||||||
|
else with wfvm.layers; [
|
||||||
|
(collapseLayers [
|
||||||
|
disable-autosleep
|
||||||
|
disable-autolock
|
||||||
|
disable-firewall
|
||||||
|
])
|
||||||
|
anaconda3 msys2 msvc msvc-ide-unbreak
|
||||||
|
];
|
||||||
|
|
||||||
|
# services = {
|
||||||
|
# # Enable remote management
|
||||||
|
# WinRm = {
|
||||||
|
# Status = "Running";
|
||||||
|
# PassThru = true;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
# License key (required)
|
||||||
|
# productKey = throw "Search the f* web"
|
||||||
|
imageSelection = "Windows 10 Pro";
|
||||||
|
|
||||||
|
|
||||||
|
# Locales
|
||||||
|
# uiLanguage = "en-US";
|
||||||
|
# inputLocale = "en-US";
|
||||||
|
# userLocale = "en-US";
|
||||||
|
# systemLocale = "en-US";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
|
let
|
||||||
|
wfvm = (import ./default.nix { inherit pkgs; });
|
||||||
|
in
|
||||||
|
wfvm.utils.wfvm-run {
|
||||||
|
name = "demo-ssh";
|
||||||
|
image = import ./demo-image.nix { inherit pkgs; };
|
||||||
|
isolateNetwork = false;
|
||||||
|
script = ''
|
||||||
|
${pkgs.sshpass}/bin/sshpass -p1234 -- ${pkgs.openssh}/bin/ssh -p 2022 wfvm@localhost -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
|
||||||
|
'';
|
||||||
|
}
|
|
@ -72,7 +72,7 @@ in
|
||||||
bootstrapper = pkgs.fetchurl {
|
bootstrapper = pkgs.fetchurl {
|
||||||
name = "RESTRICTDIST-vs_Community.exe";
|
name = "RESTRICTDIST-vs_Community.exe";
|
||||||
url = "https://aka.ms/vs/16/release/vs_community.exe";
|
url = "https://aka.ms/vs/16/release/vs_community.exe";
|
||||||
sha256 = "sha256-bxi8LsvNxSZshkTbhK/FEmMx84NKYB7TUNOm9sAKXS8=";
|
sha256 = "0b3csxz0qsafnvc0d74ywfpralwz8chv4zf9k07akpm8lp8ycgq0";
|
||||||
};
|
};
|
||||||
# This touchy-feely "community" piece of trash seems deliberately crafted to break Wine, so we use the VM to run it.
|
# This touchy-feely "community" piece of trash seems deliberately crafted to break Wine, so we use the VM to run it.
|
||||||
download-vs = wfvm.utils.wfvm-run {
|
download-vs = wfvm.utils.wfvm-run {
|
||||||
|
|
14
wfvm/win.nix
14
wfvm/win.nix
|
@ -24,16 +24,6 @@ let
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
# bundle
|
|
||||||
bundleInstaller = pkgs.runCommandNoCC "win-bundle-installer.exe" {} ''
|
|
||||||
mkdir bundle
|
|
||||||
cd bundle
|
|
||||||
cp ${bundle/go.mod} go.mod
|
|
||||||
cp ${bundle/main.go} main.go
|
|
||||||
env HOME=$(mktemp -d) GOOS=windows GOARCH=amd64 ${pkgs.go}/bin/go build
|
|
||||||
mv bundle.exe $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
runQemuCommand = name: command: (
|
runQemuCommand = name: command: (
|
||||||
pkgs.runCommandNoCC name { buildInputs = [ p7zip utils.qemu libguestfs ]; }
|
pkgs.runCommandNoCC name { buildInputs = [ p7zip utils.qemu libguestfs ]; }
|
||||||
(
|
(
|
||||||
|
@ -47,8 +37,8 @@ let
|
||||||
);
|
);
|
||||||
|
|
||||||
windowsIso = if windowsImage != null then windowsImage else pkgs.requireFile rec {
|
windowsIso = if windowsImage != null then windowsImage else pkgs.requireFile rec {
|
||||||
name = "xks67i4frg8k7rmlv5298aac0s4n5nih-RESTRICTDIST-release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso";
|
name = "Win10_21H2_English_x64.iso";
|
||||||
sha256 = "0fmw30g7959bh47z8xi5pmmxq4kb0sxs1qxf51il3xy2f2py33v6";
|
sha256 = "0kr3m0bjy086whcbssagsshdxj6lffcz7wmvbh50zhrkxgq3hrbz";
|
||||||
message = "Get ${name} from https://www.microsoft.com/en-us/software-download/windows10ISO";
|
message = "Get ${name} from https://www.microsoft.com/en-us/software-download/windows10ISO";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue