mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-10 22:31:12 +00:00
`literalExpression` is intended just to signify code that needs to stay a string that gets represented exactly as-is for docs. It has been misused heavily and people get confused repeatedly on when or not to use it because of the rampant misuse.
60 lines
1.5 KiB
Nix
60 lines
1.5 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.programs.tmux;
|
|
yamlFormat = pkgs.formats.yaml { };
|
|
in
|
|
{
|
|
meta.maintainers = [ lib.maintainers.britter ];
|
|
|
|
options.programs.tmux.tmuxinator = {
|
|
enable = lib.mkEnableOption "tmuxinator";
|
|
|
|
package = lib.mkPackageOption pkgs "tmuxinator" { nullable = true; };
|
|
|
|
projects = lib.mkOption {
|
|
type = lib.types.attrsOf yamlFormat.type;
|
|
default = { };
|
|
description = ''
|
|
Tmuxinator projects to write to {file}`$HOME/.config/tmuxinator`.
|
|
One project configuration file is generated per attribute.
|
|
See <https://github.com/tmuxinator/tmuxinator> for the project
|
|
configuration format.
|
|
'';
|
|
example = {
|
|
myproject = {
|
|
root = "~/code/myproject";
|
|
windows = [
|
|
{
|
|
editor = {
|
|
layout = "main-vertical";
|
|
panes = [
|
|
{ editor = [ "vim" ]; }
|
|
"guard"
|
|
];
|
|
};
|
|
}
|
|
{ server = "bundle exec rails s"; }
|
|
{ logs = "tail -f log/development.log"; }
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf (cfg.enable && cfg.tmuxinator.enable) {
|
|
home.packages = lib.mkIf (cfg.tmuxinator.package != null) [ cfg.tmuxinator.package ];
|
|
|
|
xdg.configFile = lib.mapAttrs' (
|
|
k: v:
|
|
lib.nameValuePair "tmuxinator/${k}.yml" {
|
|
source = yamlFormat.generate "${k}.yml" v;
|
|
}
|
|
) cfg.tmuxinator.projects;
|
|
};
|
|
}
|