/tmux

My personalized version of tmux, made with Nix.

Primary LanguageNix

✨ tmux Plus Ultra ✨

Nix Flakes Ready Built With Snowfall

  

Customized tmux, ready for development out of the box.

Screenshots

Clean FZF Tiling Windows

Try Without Installing

You can try this configuration out without committing to installing it on your system by running the following command.

nix run github:jakehamilton/tmux

Install

Nix Profile

You can install this package imperatively with the following command.

nix profile install github:jakehamilton/tmux

Nix Configuration

You can install this package by adding it as an input to your Nix flake.

{
	description = "My system flake";

	inputs = {
		nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";

		# Snowfall is not required, but will make configuration easier for you.
		snowfall-lib = {
			url = "github:snowfallorg/lib";
			inputs.nixpkgs.follows = "nixpkgs";
		};

		tmux = {
			url = "github:jakehamilton/tmux";
			inputs.nixpkgs.follows = "nixpkgs";
		};
	};

	outputs = inputs:
		inputs.snowfall-lib.mkFlake {
			inherit inputs;
			src = ./.;

			overlays = with inputs; [
				# Use the overlay provided by this flake.
				tmux.overlay

				# There is also a named overlay, though the output is the same.
				tmux.overlays."nixpkgs/plusultra"
			];
		};
}

If you've added the overlay from this flake, then in your system configuration you can add the plusultra.tmux package.

{ pkgs }:

{
	environment.systemPackages = with pkgs; [
		plusultra.tmux
	];
}

Lib

This flake exports a utility library for creating your own customized version of tmux.

lib.mkConfig

Create a tmux configuration file.

Type: Attrs -> Path

Usage:

mkConfig {
	# You must pass through nixpkgs.
	inherit pkgs;

	# All other attributes are optional.
	shell = "${pkgs.bash}/bin/bash";

	plugins = with pkgs.tmuxPlugins; [
		nord
	];

	extra-config = ''
		set -g history-limit 1000
	'';
}

Customization

The tmux package in this flake can be overriden to use a custom configuration. See the following example for how to create your own derivation.

{
	description = "My tmux flake";

	inputs = {
		nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";

		# Snowfall is not required, but will make configuration easier for you.
		snowfall-lib = {
			url = "github:snowfallorg/lib";
			inputs.nixpkgs.follows = "nixpkgs";
		};

		tmux = {
			url = "github:jakehamilton/tmux";
			inputs.nixpkgs.follows = "nixpkgs";
		};
	};

	outputs = inputs:
		let
			lib = inputs.snowfall-lib.mkLib {
				inherit inputs;
				src = ./.;
			};
		in
		lib.mkFlake {
			outputs-builder = channels:
				let
					pkgs = channels.nixpkgs;
					inherit (inputs.tmux.packages.${pkgs.system}) tmux;
				in
				{
					packages.custom-tmux = tmux.override {
						tmux-config = lib.tmux.mkConfig {
							inherit pkgs;

							plugins = with pkgs.tmuxPlugins; [
								nord
								tilish
								tmux-fzf
							];

							extra-config = ''
								set -g history-limit 2000
							'';
						};
					};
				};
		};
}