diff options
author | h7x4 <h7x4@nani.wtf> | 2023-10-19 20:26:01 +0200 |
---|---|---|
committer | h7x4 <h7x4@nani.wtf> | 2023-12-01 01:35:29 +0100 |
commit | f12eabdcbe642884b37cb5d20dbf781f998061f7 (patch) | |
tree | 1606e79ae46f86e9d5c9bf7bab58aab5ffc1be45 /nixos | |
parent | 9b11307f42bb14d8f3ba50eb8bd80ab7dbbbec9f (diff) | |
download | nixlib-f12eabdcbe642884b37cb5d20dbf781f998061f7.tar nixlib-f12eabdcbe642884b37cb5d20dbf781f998061f7.tar.gz nixlib-f12eabdcbe642884b37cb5d20dbf781f998061f7.tar.bz2 nixlib-f12eabdcbe642884b37cb5d20dbf781f998061f7.tar.lz nixlib-f12eabdcbe642884b37cb5d20dbf781f998061f7.tar.xz nixlib-f12eabdcbe642884b37cb5d20dbf781f998061f7.tar.zst nixlib-f12eabdcbe642884b37cb5d20dbf781f998061f7.zip |
nixos/screen: clean up
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/doc/manual/release-notes/rl-2405.section.md | 2 | ||||
-rw-r--r-- | nixos/modules/programs/screen.nix | 38 |
2 files changed, 24 insertions, 16 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 6c697b580838..0351b12f56d9 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -8,7 +8,7 @@ In addition to numerous new and upgraded packages, this release has the followin <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. --> -- Create the first release note entry in this section! +- `screen`'s module has been cleaned, and will now require you to set `programs.screen.enable` in order to populate `screenrc` and add the program to the environment. ## New Services {#sec-release-24.05-new-services} diff --git a/nixos/modules/programs/screen.nix b/nixos/modules/programs/screen.nix index 68de9e52d7be..41bfb5d7809a 100644 --- a/nixos/modules/programs/screen.nix +++ b/nixos/modules/programs/screen.nix @@ -1,33 +1,41 @@ { config, lib, pkgs, ... }: let - inherit (lib) mkOption mkIf types; cfg = config.programs.screen; in { - ###### interface - options = { programs.screen = { + enable = lib.mkEnableOption (lib.mdDoc "screen, a basic terminal multiplexer"); + + package = lib.mkPackageOptionMD pkgs "screen" { }; - screenrc = mkOption { - default = ""; - description = lib.mdDoc '' - The contents of /etc/screenrc file. + screenrc = lib.mkOption { + type = with lib.types; nullOr lines; + example = '' + defscrollback 10000 + startup_message off ''; - type = types.lines; + description = lib.mdDoc "The contents of {file}`/etc/screenrc` file"; }; }; }; - ###### implementation - - config = mkIf (cfg.screenrc != "") { - environment.etc.screenrc.text = cfg.screenrc; - - environment.systemPackages = [ pkgs.screen ]; + 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 ]; security.pam.services.screen = {}; }; - } |