nixpkgs/nixos/modules/programs/screen.nix

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

42 lines
1,022 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2013-11-04 09:00:34 +01:00
let
cfg = config.programs.screen;
in
{
options = {
programs.screen = {
2023-10-19 20:26:01 +02:00
enable = lib.mkEnableOption (lib.mdDoc "screen, a basic terminal multiplexer");
package = lib.mkPackageOptionMD pkgs "screen" { };
2013-11-04 09:00:34 +01:00
2023-10-19 20:26:01 +02:00
screenrc = lib.mkOption {
type = with lib.types; nullOr lines;
example = ''
defscrollback 10000
startup_message off
2013-11-04 09:00:34 +01:00
'';
2023-10-19 20:26:01 +02:00
description = lib.mdDoc "The contents of {file}`/etc/screenrc` file";
2013-11-04 09:00:34 +01:00
};
};
};
2023-10-19 20:26:01 +02:00
config = {
# TODO: Added in 24.05, remove before 24.11
assertions = [
{
assertion = cfg.screenrc != null -> cfg.enable;
message = "`programs.screen.screenrc` has been configured, but `programs.screen.enable` is not true";
}
];
} // lib.mkIf cfg.enable {
environment.etc.screenrc = {
enable = cfg.screenrc != null;
text = cfg.screenrc;
};
environment.systemPackages = [ cfg.package ];
2020-01-03 16:16:25 +01:00
security.pam.services.screen = {};
2013-11-04 09:00:34 +01:00
};
}