mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 08:39:42 -04:00
38 lines
724 B
Nix
38 lines
724 B
Nix
{ lib, config, ... }:
|
|
|
|
with lib;
|
|
let
|
|
tmux = config.modules.user.tmux;
|
|
gui = config.modules.user.gui.wm;
|
|
sway = config.modules.user.gui.wm.sway;
|
|
hyprland = config.modules.user.gui.wm.hyprland;
|
|
|
|
wm = {
|
|
enable = builtins.any (mod: mod.enable or false) (builtins.attrValues gui);
|
|
};
|
|
|
|
in
|
|
''
|
|
case $- in
|
|
*i*)
|
|
${optionalString wm.enable ''
|
|
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
|
${optionalString sway.enable ''
|
|
exec sway
|
|
''
|
|
}
|
|
${optionalString hyprland.enable ''
|
|
exec Hyprland
|
|
''
|
|
}
|
|
exit 0
|
|
fi
|
|
''}
|
|
${optionalString tmux.enable ''
|
|
if [ -z "$DISPLAY" ] && [ -z "$TMUX" ]; then
|
|
exec tmux
|
|
fi
|
|
''}
|
|
;;
|
|
esac
|
|
''
|