1
Fork 0
satellite/home/features/wayland/wlsunset.nix

27 lines
580 B
Nix
Raw Normal View History

{ pkgs, lib, ... }:
let
libnotify = lib.getExe pkgs.libnotify;
wlsunset-toggle = pkgs.writeShellScriptBin "wlsunset-toggle" ''
if [ "active" = "$(systemctl --user is-active wlsunset.service)" ]
then
systemctl --user stop wlsunset.service
${libnotify} "Stopped wlsunset"
else
systemctl --user start wlsunset.service
${libnotify} "Started wlsunset"
fi
'';
in
2023-05-31 04:53:44 +02:00
{
services.wlsunset = {
enable = true;
# Random Netherlands coordinates
latitude = "53.2";
longitude = "6.5";
};
home.packages = [ wlsunset-toggle ];
2023-05-31 04:53:44 +02:00
}