{ pkgs, system }: let sources = { windows = { "6.1.7601" = { professional = let key = "HYF8J-CVRMY-CM74G-RPHKF-PW487"; in { x86.url = "https://archive.org/download/win-7-pro-32-64-iso/32-bit/GSP1RMCPRXFRER_EN_DVD.ISO"; x86.hash = "sha256-TPG6ryqzCgXJ9K70krterEa6oqqIZyAPDJzsW5SMy5U="; x86_64.url = "https://archive.org/download/win-7-pro-32-64-iso/64-bit/GSP1RMCPRXFRER_EN_DVD.ISO"; x86_64.hash = "sha256-ug50400prU2W4VW51KngN/0A80d+n8HhVuos2dBykUs="; x86.extraUnattendConfig.productKey = key; x86_64.extraUnattendConfig.productKey = key; }; }; }; }; unattend = import ./windows/unattend.nix { inherit pkgs; }; in { windows = builtins.mapAttrs (version: v: builtins.mapAttrs (edition: vv: builtins.mapAttrs (arch: vvv: { installer = derivation { name = "windows-" + version + "-" + edition + "-" + arch + "-installer"; inherit system; builder = "${pkgs.fish}/bin/fish"; args = [ ./lib/copy-file.fish "out.iso" ]; src = pkgs.fetchurl { inherit (vvv) url hash; }; inherit (pkgs) coreutils; }; unattend = derivation { name = "windows-" + version + "-" + edition + "-" + arch + "-unattend"; inherit system; builder = "${pkgs.fish}/bin/fish"; args = [ ./lib/mkiso.fish "out.iso" ]; src = pkgs.writeText "Autounattend.xml" (unattend.genConfig (pkgs.lib.attrsets.recursiveUpdate unattend.default vvv.extraUnattendConfig )); inherit (pkgs) coreutils libisoburn; }; }) vv ) v ) sources.windows; ubuntu = {}; }