Compare commits
5 commits
737747f8f5
...
607d11bbad
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 607d11bbad | ||
Bruno BELANYI | 06989facc2 | ||
Bruno BELANYI | 55b828cba9 | ||
Bruno BELANYI | 34c13b077f | ||
Bruno BELANYI | 0bbf522c03 |
|
@ -3,8 +3,10 @@ let
|
||||||
cfg = config.my.home.zsh;
|
cfg = config.my.home.zsh;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.home.zsh = with lib.my; {
|
options.my.home.zsh = with lib; {
|
||||||
enable = mkDisableOption "zsh configuration";
|
enable = my.mkDisableOption "zsh configuration";
|
||||||
|
|
||||||
|
launchTmux = mkEnableOption "auto launch tmux at shell start";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
@ -44,14 +46,16 @@ in
|
||||||
defaultKeymap = "emacs";
|
defaultKeymap = "emacs";
|
||||||
|
|
||||||
# Make those happen early to avoid doing double the work
|
# Make those happen early to avoid doing double the work
|
||||||
initExtraFirst =
|
initExtraFirst = ''
|
||||||
lib.optionalString config.my.home.tmux.enable ''
|
${
|
||||||
# Launch tmux unless already inside one
|
lib.optionalString cfg.launchTmux ''
|
||||||
if [ -z "$TMUX" ]; then
|
# Launch tmux unless already inside one
|
||||||
exec tmux new-session
|
if [ -z "$TMUX" ]; then
|
||||||
fi
|
exec tmux new-session
|
||||||
''
|
fi
|
||||||
;
|
''
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
source ${./completion-styles.zsh}
|
source ${./completion-styles.zsh}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
|
./home.nix
|
||||||
./networking.nix
|
./networking.nix
|
||||||
./services.nix
|
./services.nix
|
||||||
./users.nix
|
./users.nix
|
||||||
|
|
7
machines/porthos/home.nix
Normal file
7
machines/porthos/home.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
my.home = {
|
||||||
|
# Always start a tmux session when opening a shell session
|
||||||
|
zsh.launchTmux = true;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue