about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorPeter Hoeg <peter@speartail.com>2016-03-23 15:33:28 +0800
committerPeter Hoeg <peter@speartail.com>2016-03-27 13:24:09 +0800
commita314814c19fa9744ee3f3c333a1c00b27574b90e (patch)
tree3cdabc46ca73f09bea9b239b3313a345a06f4cac /nixos
parent954925771482b50493a24615c6e7e82e044a4fdf (diff)
downloadnixlib-a314814c19fa9744ee3f3c333a1c00b27574b90e.tar
nixlib-a314814c19fa9744ee3f3c333a1c00b27574b90e.tar.gz
nixlib-a314814c19fa9744ee3f3c333a1c00b27574b90e.tar.bz2
nixlib-a314814c19fa9744ee3f3c333a1c00b27574b90e.tar.lz
nixlib-a314814c19fa9744ee3f3c333a1c00b27574b90e.tar.xz
nixlib-a314814c19fa9744ee3f3c333a1c00b27574b90e.tar.zst
nixlib-a314814c19fa9744ee3f3c333a1c00b27574b90e.zip
tmux nixos module: add nixos program module for tmux
This basic module allows you to specify the tmux configuration.

As great as tmux is, some of the defaults are pretty awful, so having a
way to specify the config really helps.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/programs/tmux.nix35
2 files changed, 36 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 3dd60ad99dca..934fb56bc10d 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -77,6 +77,7 @@
   ./programs/shell.nix
   ./programs/ssh.nix
   ./programs/ssmtp.nix
+  ./programs/tmux.nix
   ./programs/venus.nix
   ./programs/wvdial.nix
   ./programs/xfs_quota.nix
diff --git a/nixos/modules/programs/tmux.nix b/nixos/modules/programs/tmux.nix
new file mode 100644
index 000000000000..4220a2e17b3f
--- /dev/null
+++ b/nixos/modules/programs/tmux.nix
@@ -0,0 +1,35 @@
+{ config, pkgs, lib, ... }:
+
+let
+  inherit (lib) mkOption mkEnableOption mkIf mkMerge types;
+
+  cfg = config.programs.tmux;
+
+in
+{
+  ###### interface
+
+  options = {
+    programs.tmux = {
+
+      enable = mkEnableOption "<command>tmux</command> - a <command>screen</command> replacement.";
+
+      tmuxconf = mkOption {
+        default = "";
+        description = ''
+          The contents of /etc/tmux.conf
+        '';
+        type = types.lines;
+      };
+    };
+  };
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+    environment = {
+      systemPackages = [ pkgs.tmux ];
+      etc."tmux.conf".text = cfg.tmuxconf;
+    };
+  };
+}