aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/default.nix
blob: 8af472ab8c0e6ed7584c255dc21a0c82c48dde92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
  lib,
  config,
  pkgs,
  ...
}:

{
  imports = [
    ./i3
    ./gtk
    ./polybar
  ];

  options.desktop = {
    enable = lib.mkEnableOption "Enables graphical interface.";
  };

  config = lib.mkIf config.desktop.enable {
    xdg.enable = true;
    xsession.enable = true;

    home.file.".xinitrc" = {
      text = ''
        #!/bin/sh

        [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources
        [ -f ~/.profile ] && . ~/.profile
        [ -f ~/.xsession ] && . ~/.xsession

        exec ${config.xsession.windowManager.i3.package}/bin/i3
      '';
      executable = true;
    };
  };
}