summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/upstream/desktop-managers/coma.nix
blob: e12f4b981212337d8afae9d9da2b197da6608909 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ config, pkgs, lib, ... }:
with lib;
{
  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
      '';
    };
  };
}