2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.screen;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
programs.screen = {
|
2024-04-21 15:54:59 +00:00
|
|
|
enable = lib.mkEnableOption "screen, a basic terminal multiplexer";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
package = lib.mkPackageOption pkgs "screen" { };
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
screenrc = lib.mkOption {
|
2024-06-05 15:53:02 +00:00
|
|
|
type = lib.types.lines;
|
|
|
|
default = "";
|
2024-01-02 11:29:13 +00:00
|
|
|
example = ''
|
|
|
|
defscrollback 10000
|
|
|
|
startup_message off
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "The contents of {file}`/etc/screenrc` file";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
config = lib.mkMerge [
|
|
|
|
{
|
|
|
|
# TODO: Added in 24.05, remove before 24.11
|
|
|
|
assertions = [
|
|
|
|
{
|
|
|
|
assertion = cfg.screenrc != "" -> cfg.enable;
|
|
|
|
message = "`programs.screen.screenrc` has been configured, but `programs.screen.enable` is not true";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
(lib.mkIf cfg.enable {
|
|
|
|
environment.etc.screenrc = {
|
|
|
|
text = cfg.screenrc;
|
|
|
|
};
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
security.pam.services.screen = {};
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|