about summary refs log tree commit diff
path: root/nixos/modules/programs/tmux.nix
blob: 4220a2e17b3fd596571b9b2d584d4372ad13254c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
    };
  };
}