nixos/coma: init sleep as desktop manager

This commit is contained in:
tv 2021-01-25 01:46:22 +01:00
parent 46f57b4388
commit 21303714af
2 changed files with 22 additions and 0 deletions

View File

@ -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
'';
};
};
}

View File

@ -1,5 +1,6 @@
{
imports = [
./coma.nix
./none.nix
];
}