summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/upstream/desktop-managers/coma.nix
blob: 95db7fb5c8f91fda468b02d1df28945908cecf61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
with import <stockholm/lib>;
{ config, pkgs, ... }: {
  options = {
    services.xserver.desktopManager.coma = {
      enable = mkEnableOption "sleep as a desktop manager";
    };
  };
  config = mkIf config.services.xserver.desktopManager.coma.enable {
    services.xserver.desktopManager.session = singleton {
      name = "coma";
      bgSupport = true;
      start = /* sh */ ''
        if test -n "$waitPID"; then
          ${pkgs.uutils-coreutils}/bin/uutils-sleep 1s && kill $waitPID &
          wait $waitPID
        fi
        exec -a sleep ${pkgs.uutils-coreutils}/bin/uutils-sleep infinity
      '';
    };
  };
}