about summary refs log tree commit diff
path: root/nixos/modules/programs/mosh.nix
blob: b478f8e180faec00076c9a20ea08a1be17fd74bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ config, lib, pkgs, ... }:

with lib;

let

  cfg  = config.programs.mosh;

in
{
  options.programs.mosh = {
      enable = mkOption {
	description = ''
	  Whether to enable mosh. Note, this will open ports in your firewall!
	'';
        default = false;
	example = true;
	type = lib.types.bool;
      };
  };

  config = mkIf cfg.enable {
    environment.systemPackages = with pkgs; [ mosh ];
    networking.firewall.allowedUDPPortRanges = [ { from = 60000; to = 61000; } ];
  };
}