rosetta.nix 477 B

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