nixos/modules/system/binfmt.nix

13 lines
415 B
Nix
Raw Normal View History

2024-03-05 15:35:31 +08:00
inputs:
{
options.nixos.system.binfmt = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = inputs.config.nixos.packages.packageSet == "workstation"; };
2024-03-05 15:35:31 +08:00
};
config = inputs.lib.mkIf inputs.config.nixos.system.binfmt.enable
{
programs.java = { enable = true; binfmt = true; };
boot.binfmt.emulatedSystems = [ "aarch64-linux" "x86_64-windows" ];
};
}