mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 22:53:42 +00:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
40 lines
1.1 KiB
Nix
40 lines
1.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.programs.mosh;
|
|
|
|
in
|
|
{
|
|
options.programs.mosh = {
|
|
enable = lib.mkEnableOption "mosh";
|
|
openFirewall = lib.mkEnableOption "" // {
|
|
description = "Whether to automatically open the necessary ports in the firewall.";
|
|
default = true;
|
|
};
|
|
withUtempter = lib.mkEnableOption "" // {
|
|
description = ''
|
|
Whether to enable libutempter for mosh.
|
|
|
|
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;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
environment.systemPackages = [ pkgs.mosh ];
|
|
networking.firewall.allowedUDPPortRanges = lib.optional cfg.openFirewall { from = 60000; to = 61000; };
|
|
security.wrappers = lib.mkIf cfg.withUtempter {
|
|
utempter = {
|
|
source = "${pkgs.libutempter}/lib/utempter/utempter";
|
|
owner = "root";
|
|
group = "utmp";
|
|
setuid = false;
|
|
setgid = true;
|
|
};
|
|
};
|
|
};
|
|
}
|