summary refs log tree commit diff
path: root/nixos/modules/programs/screen.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/programs/screen.nix')
-rw-r--r--nixos/modules/programs/screen.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/nixos/modules/programs/screen.nix b/nixos/modules/programs/screen.nix
new file mode 100644
index 00000000000..728a0eb8cea
--- /dev/null
+++ b/nixos/modules/programs/screen.nix
@@ -0,0 +1,33 @@
+{ config, lib, pkgs, ... }:
+
+let
+  inherit (lib) mkOption mkIf types;
+  cfg = config.programs.screen;
+in
+
+{
+  ###### interface
+
+  options = {
+    programs.screen = {
+
+      screenrc = mkOption {
+        default = "";
+        description = ''
+          The contents of /etc/screenrc file.
+        '';
+        type = types.lines;
+      };
+    };
+  };
+
+  ###### implementation
+
+  config = mkIf (cfg.screenrc != "") {
+    environment.etc.screenrc.text = cfg.screenrc;
+
+    environment.systemPackages = [ pkgs.screen ];
+    security.pam.services.screen = {};
+  };
+
+}