nixpkgs/nixos/modules/programs/screen.nix

45 lines
1021 B
Nix
Raw Permalink Normal View History

{ config, lib, pkgs, ... }:
2013-11-04 08:00:34 +00:00
let
cfg = config.programs.screen;
in
{
options = {
programs.screen = {
enable = lib.mkEnableOption "screen, a basic terminal multiplexer";
2023-10-19 18:26:01 +00:00
package = lib.mkPackageOption pkgs "screen" { };
2013-11-04 08:00:34 +00:00
2023-10-19 18:26:01 +00:00
screenrc = lib.mkOption {
type = lib.types.lines;
default = "";
2023-10-19 18:26:01 +00:00
example = ''
defscrollback 10000
startup_message off
2013-11-04 08:00:34 +00:00
'';
description = "The contents of {file}`/etc/screenrc` file";
2013-11-04 08:00:34 +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 = {};
})
];
2013-11-04 08:00:34 +00:00
}