nixpkgs/nixos/modules/programs/mosh.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
934 B
Nix
Raw Normal View History

2016-03-26 03:22:52 +00:00
{ config, lib, pkgs, ... }:
let
cfg = config.programs.mosh;
in
{
options.programs.mosh = {
2023-12-16 12:53:30 +11:00
enable = lib.mkEnableOption "mosh";
withUtempter = lib.mkEnableOption "" // {
description = lib.mdDoc ''
Whether to enable libutempter for mosh.
2023-12-16 12:53:30 +11:00
This is required so that mosh can write to /var/run/utmp (which can be queried with `who` to display currently connected user sessions).
Note, this will add a guid wrapper for the group utmp!
'';
default = true;
};
2016-03-26 03:22:52 +00:00
};
2023-12-16 12:53:30 +11:00
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.mosh ];
2016-03-26 03:22:52 +00:00
networking.firewall.allowedUDPPortRanges = [ { from = 60000; to = 61000; } ];
2023-12-16 12:53:30 +11:00
security.wrappers = lib.mkIf cfg.withUtempter {
utempter = {
source = "${pkgs.libutempter}/lib/utempter/utempter";
2021-10-03 11:43:13 +02:00
owner = "root";
group = "utmp";
setuid = false;
setgid = true;
};
};
2016-03-26 03:22:52 +00:00
};
}