1
0

rosetta.nix 473 B

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