nix_config/home/gui/startx.nix

27 lines
501 B
Nix
Raw Normal View History

2024-09-05 20:28:09 +02:00
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.local.gui.startx;
in {
options.local.gui.startx.enable = mkEnableOption "startx";
config = mkIf cfg.enable {
xsession.enable = true;
home.file.".xinitrc".source = let
content =
if config.local.nixos
then ''
exec ~/.xsession
''
else ''
exec ${pkgs.nixgl.nixGLIntel}/bin/nixGLIntel ~/.xsession
'';
in
pkgs.writeShellScript "xinitrc" content;
};
}