Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

49 lines
1.2 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.mosh;
in
{
options.programs.mosh = {
enable = lib.mkEnableOption "mosh";
package = lib.mkPackageOption pkgs "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 = [ cfg.package ];
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;
};
};
};
}