home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit bdf2918c8fa769d597f94e945a72e5d7dce0faae
parent 8a3255be40e4af5eb6f60173e9c4d864c8430339
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Thu,  1 Nov 2018 13:33:22 +0100

profiles: add tmux and enable it by default

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mbase.nix | 17+----------------
Mmodules/module-list.nix | 1+
Rtmux/keybindings -> modules/profiles/assets/tmux/keybindings | 0
Rtmux/tmux.conf -> modules/profiles/assets/tmux/tmux.conf | 0
Amodules/profiles/tmux.nix | 34++++++++++++++++++++++++++++++++++
5 files changed, 36 insertions(+), 16 deletions(-)

diff --git a/base.nix b/base.nix @@ -3,7 +3,7 @@ let home_directory = builtins.getEnv "HOME"; in rec { -imports = [ modules/module-list.nix ]; + imports = [ modules/module-list.nix ]; programs = { home-manager = { enable = true; @@ -11,21 +11,6 @@ imports = [ modules/module-list.nix ]; }; }; home.file.".nix-channels".source = ./nix-channels; - home.file.".tmux.conf".text = '' - source-file $HOME/.config/tmux/tmux.conf - set-environment -g TMUX_PLUGIN_MANAGER_PATH '$HOME/.config/tmux/plugins' - - set -g @plugin 'tmux-plugins/tpm' - set -g @plugin 'tmux-plugins/tmux-resurrect' - set -g @plugin 'tmux-plugins/tmux-continuum' - set -g @plugin 'tmux-plugins/tmux-copycat' - - set -g @continuum-restore 'on' - - run '${pkgs.tmux-tpm}/tpm' -''; - xdg.configFile."tmux/tmux.conf".source = ./tmux/tmux.conf; - xdg.configFile."tmux/commons/keybindings".source = ./tmux/keybindings; home.packages = with pkgs; [ scripts direnv diff --git a/modules/module-list.nix b/modules/module-list.nix @@ -7,6 +7,7 @@ ./profiles/ssh.nix ./profiles/fish.nix ./profiles/i3.nix + ./profiles/tmux.nix ./services/shairport-sync.nix ]; } diff --git a/tmux/keybindings b/modules/profiles/assets/tmux/keybindings diff --git a/tmux/tmux.conf b/modules/profiles/assets/tmux/tmux.conf diff --git a/modules/profiles/tmux.nix b/modules/profiles/tmux.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.profiles.tmux; +in +{ + options = { + profiles.tmux = { + enable = mkOption { + default = true; + description = "Enable tmux profile and configuration"; + type = types.bool; + }; + }; + }; + config = mkIf cfg.enable { + home.file.".tmux.conf".text = '' + source-file $HOME/.config/tmux/tmux.conf + set-environment -g TMUX_PLUGIN_MANAGER_PATH '$HOME/.config/tmux/plugins' + + set -g @plugin 'tmux-plugins/tpm' + set -g @plugin 'tmux-plugins/tmux-resurrect' + set -g @plugin 'tmux-plugins/tmux-continuum' + set -g @plugin 'tmux-plugins/tmux-copycat' + + set -g @continuum-restore 'on' + + run '${pkgs.tmux-tpm}/tpm' + ''; + xdg.configFile."tmux/tmux.conf".source = ./assets/tmux/tmux.conf; + xdg.configFile."tmux/commons/keybindings".source = ./assets/tmux/keybindings; + }; +}