remote-login.nix 452 B

123456789101112131415161718192021222324252627
  1. {
  2. config,
  3. lib,
  4. ...
  5. }:
  6. with lib;
  7. let
  8. cfg = config.networking;
  9. remoteLogin = optionalString (cfg.remote-login) ''
  10. systemsetup -setremotelogin on
  11. '';
  12. in
  13. {
  14. options = {
  15. networking.remote-login = mkEnableOption "remote login";
  16. };
  17. config = {
  18. system.activationScripts.networking.text = mkIf cfg.remote-login (mkAfter ''
  19. # enable remote login
  20. echo "enabling remote login..." >&2
  21. ${remoteLogin}
  22. '');
  23. };
  24. }