35 lines
1.1 KiB
Nix
35 lines
1.1 KiB
Nix
{
|
|
pkgs,
|
|
inputs,
|
|
hostname ? "server",
|
|
}:
|
|
let
|
|
utils = import ./scheme-utils.nix { inherit pkgs inputs; };
|
|
schemes = utils.availableSchemes;
|
|
mkBuildScript =
|
|
scheme:
|
|
pkgs.writeShellScript "build-${scheme}" ''
|
|
echo "Building NixOS configuration with scheme: ${scheme}"
|
|
nix build .#nixosConfigurations.${hostname}.config.system.build.toplevel \
|
|
--override-input stylix-scheme ${scheme} \
|
|
--out-link ./result-${scheme}
|
|
echo "Build completed for scheme: ${scheme}"
|
|
'';
|
|
buildAllScript = pkgs.writeShellScript "build-all-schemes" ''
|
|
echo "Building all ${toString (builtins.length schemes)} schemes in parallel..."
|
|
echo "Schemes: ${builtins.concatStringsSep " " schemes}"
|
|
${builtins.concatStringsSep "\n" (map (scheme: "${mkBuildScript scheme} &") schemes)}
|
|
wait
|
|
echo "All schemes built successfully!"
|
|
echo "Results available in ./result-* directories"
|
|
'';
|
|
|
|
in
|
|
{
|
|
inherit schemes buildAllScript;
|
|
buildScripts = builtins.listToAttrs (
|
|
map (scheme: pkgs.lib.nameValuePair "build-${scheme}" (mkBuildScript scheme)) schemes
|
|
);
|
|
inherit (utils) lightSchemes darkSchemes availableColors;
|
|
}
|