summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/upstream
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2021-01-25 01:46:22 +0100
committertv <tv@krebsco.de>2021-01-26 20:54:47 +0100
commit21303714afa87ca3081a9fbc4585d86badc131bb (patch)
tree2a62010b52ab0f7d9ccbe7fd178a1a3cdb04d609 /krebs/3modules/upstream
parent46f57b43888027bd245d14087fc096329729cb03 (diff)
nixos/coma: init sleep as desktop manager
Diffstat (limited to 'krebs/3modules/upstream')
-rw-r--r--krebs/3modules/upstream/desktop-managers/coma.nix21
-rw-r--r--krebs/3modules/upstream/desktop-managers/default.nix1
2 files changed, 22 insertions, 0 deletions
diff --git a/krebs/3modules/upstream/desktop-managers/coma.nix b/krebs/3modules/upstream/desktop-managers/coma.nix
new file mode 100644
index 000000000..95db7fb5c
--- /dev/null
+++ b/krebs/3modules/upstream/desktop-managers/coma.nix
@@ -0,0 +1,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
+ '';
+ };
+ };
+}
diff --git a/krebs/3modules/upstream/desktop-managers/default.nix b/krebs/3modules/upstream/desktop-managers/default.nix
index 4f60ee27d..22e75439d 100644
--- a/krebs/3modules/upstream/desktop-managers/default.nix
+++ b/krebs/3modules/upstream/desktop-managers/default.nix
@@ -1,5 +1,6 @@
{
imports = [
+ ./coma.nix
./none.nix
];
}