summaryrefslogtreecommitdiffstats
path: root/nixos/modules/programs/tmux.nix
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/modules/programs/tmux.nix
parent954925771482b50493a24615c6e7e82e044a4fdf (diff)
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/modules/programs/tmux.nix')
-rw-r--r--nixos/modules/programs/tmux.nix35
1 files changed, 35 insertions, 0 deletions
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;
+ };
+ };
+}