rosetta.nix 474 B

12345678910111213141516171819202122232425
  1. { config, lib, ... }:
  2. with lib;
  3. let
  4. cfg = config.system.rosetta;
  5. in
  6. {
  7. options = {
  8. system.rosetta.enable = mkOption {
  9. type = types.bool;
  10. default = false;
  11. description = "Whether to enable Rosetta.";
  12. };
  13. };
  14. config = {
  15. system.activationScripts.extraActivation.text = optionalString cfg.enable (mkAfter ''
  16. # enable rosetta
  17. echo "enable rosetta..." >&2
  18. softwareupdate --install-rosetta --agree-to-license
  19. '');
  20. };
  21. }