Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmux: use xdg config path #1928

Merged
merged 1 commit into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions modules/programs/tmux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ let
}
)];

home.file.".tmux.conf".text = ''
xdg.configFile."tmux/tmux.conf".text = ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this whole change should be gated behind a new state version. See https://github.com/nix-community/home-manager/pull/1919/files#diff-f1f119fe42c1c025c898ab5a4b5063f7867d8f3d327111f1b029ef13a29fe1dcR128 for an exaple of how to do this.

# ============================================= #
# Load plugins with Home Manager #
# --------------------------------------------- #
Expand Down Expand Up @@ -335,10 +335,9 @@ in
};
})

# config file ~/.tmux.conf
{ home.file.".tmux.conf".text = mkBefore tmuxConf; }
{ xdg.configFile."tmux/tmux.conf".text = mkBefore tmuxConf; }
(mkIf (cfg.plugins != []) configPlugins)
{ home.file.".tmux.conf".text = mkAfter cfg.extraConfig; }
{ xdg.configFile."tmux/tmux.conf".text = mkAfter cfg.extraConfig; }
])
);
}
4 changes: 2 additions & 2 deletions tests/modules/programs/tmux/default-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ in {
};

nmt.script = ''
assertFileExists home-files/.tmux.conf
assertFileContent home-files/.tmux.conf \
assertFileExists home-files/.config/tmux/tmux.conf
assertFileContent home-files/.config/tmux/tmux.conf \
${substituteExpected ./default-shell.conf}
'';
};
Expand Down
4 changes: 2 additions & 2 deletions tests/modules/programs/tmux/disable-confirmation-prompt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ with lib;
];

nmt.script = ''
assertFileExists home-files/.tmux.conf
assertFileContent home-files/.tmux.conf \
assertFileExists home-files/.config/tmux/tmux.conf
assertFileContent home-files/.config/tmux/tmux.conf \
${./disable-confirmation-prompt.conf}
'';
};
Expand Down
6 changes: 4 additions & 2 deletions tests/modules/programs/tmux/emacs-with-plugins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ with lib;
];

nmt.script = ''
assertFileExists home-files/.tmux.conf
assertFileContent home-files/.tmux.conf ${./emacs-with-plugins.conf}
assertFileExists home-files/.config/tmux/tmux.conf
assertFileContent home-files/.config/tmux/tmux.conf ${
./emacs-with-plugins.conf
}
'';
};
}
2 changes: 1 addition & 1 deletion tests/modules/programs/tmux/not-enabled.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ with lib;
programs.tmux = { enable = false; };

nmt.script = ''
assertPathNotExists home-files/.tmux.conf
assertPathNotExists home-files/.config/tmux/tmux.conf
'';
};
}
4 changes: 2 additions & 2 deletions tests/modules/programs/tmux/prefix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ with lib;
];

nmt.script = ''
assertFileExists home-files/.tmux.conf
assertFileContent home-files/.tmux.conf \
assertFileExists home-files/.config/tmux/tmux.conf
assertFileContent home-files/.config/tmux/tmux.conf \
${./prefix.conf}
'';
};
Expand Down
4 changes: 2 additions & 2 deletions tests/modules/programs/tmux/shortcut-without-prefix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ with lib;
];

nmt.script = ''
assertFileExists home-files/.tmux.conf
assertFileContent home-files/.tmux.conf \
assertFileExists home-files/.config/tmux/tmux.conf
assertFileContent home-files/.config/tmux/tmux.conf \
${./shortcut-without-prefix.conf}
'';
};
Expand Down
4 changes: 2 additions & 2 deletions tests/modules/programs/tmux/vi-all-true.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ with lib;
];

nmt.script = ''
assertFileExists home-files/.tmux.conf
assertFileContent home-files/.tmux.conf ${./vi-all-true.conf}
assertFileExists home-files/.config/tmux/tmux.conf
assertFileContent home-files/.config/tmux/tmux.conf ${./vi-all-true.conf}
'';
};
}