Configuring tmux without home-manager (system-wide, flakes)

Still a newbie to nix, and I am in the process of getting my previous MacOS and Linux environments ported over to Nix using flakes. My Linux setup was much smoother than the MacOS one, but this issue seems to be persisting no matter the OS… Is there a way to configure tmux globally for a system without using the home-manager module?

I’m on a single-user system (both platforms) and trying to configure tmux globally; however, the options I am setting seem to not be taking effect on a rebuild. I’m specifically using my darwin system right now since I am also doing some other overhauls of my basic flake config.

Here is my tmux config snippet:

programs.tmux = {
          enable = true;
          mouse = true;
          baseIndex = 1;
          shortcut = "Space";
          plugins = with pkgs; [
            tmuxPlugins.sensible
            tmuxPlugins.yank
            tmuxPlugins.vim-tmux-navigator
            tmuxPlugins.cpu
            {
              plugin = tmuxPlugins.catppuccin;
              extraConfig = ''
                set -g @catppuccin_flavor 'mocha'
                set -g @catppuccin_window_status_style 'rounded'
                set -g status-right-length 100
                set -g status-left-length 100
                set -g status-left ""
                set -g status-right "#{E:@catppuccin_status_application}"
                set -ag status-right "#{E:@catppuccin_status_session}"
                set -ag status-right "#{E:@catppuccin_status_uptime}"
              '';
            }
          ];
          extraConfigBeforePlugins = ''
            # Enable color
            set-option -sa terminal-overrides ",xterm*:Tc"
          '';
        };

If I include this in flake.nix under configuration, I get errors like this on a rebuild:

error: The option `programs.tmux.baseIndex' does not exist. Definition values:
       - In `<unknown-file>': 1

These options do seem to exist as far as I can tell, and I cross-checked with MyNixOS and I see them listed there as well.

Any help is appreciated. Most of the examples I can find are using home-manager, and I am trying to steer clear of it until I can really get my hands around using Nix as a whole, then migrate to a home-manager setup later.

Worth noting I can always define everything in a separate tmux.conf config file (and I do that currently). I am just trying to see if I can take advantage of Nix features to carry one less file with me everywhere I go :slight_smile:

I must have had a typo in my linux config, I just took a clean clone of my config repo to it and tried to apply the tmux configs and it worked without issue.

I also discovered that nix-darwin does not use the same options as the standard nix programs for tmux. They are similar, but not exactly the same, so I need a different flake/config for darwin. Documentation for the nix-darwin tmux options starts here: nix-darwin Configuration Options

Aside to activate the plugins you need to add in extraConfig

run-shell ${pkgs.tmuxPlugins.tmuxPlugins.sensible}/share/tmux-plugins/sensible/sensible.tmux
run-shell ${pkgs.tmuxPlugins.tmuxPlugins.yank}/share/tmux-plugins/yank/yank.tmux
run-shell ${pkgs.tmuxPlugins.tmuxPlugins.vim-tmux-navigator}/share/tmux-plugins/vim-tmux-navigator/vim-tmux-navigator.tmux
run-shell ${pkgs.tmuxPlugins.tmuxPlugins.cpu}/share/tmux-plugins/cpu/cpu.tmux