1
Fork 0
satellite/home/features/wayland/wlsunset.nix
2023-12-02 00:46:56 +01:00

28 lines
618 B
Nix

{ pkgs, ... }:
let
systemctl = "${pkgs.systemd}/bin/systemctl";
wlsunset-toggle = pkgs.writeShellScriptBin "wlsunset-toggle" ''
if [ "active" = "$(systemctl --user is-active wlsunset.service)" ]
then
${systemctl} --user stop wlsunset.service
echo "Stopped wlsunset"
else
${systemctl} --user start wlsunset.service
echo "Started wlsunset"
fi
'';
in
{
services.wlsunset = {
enable = true;
systemdTarget = "hyprland-session.target";
# Random Netherlands coordinates
latitude = "53.2";
longitude = "6.5";
};
home.packages = [ wlsunset-toggle ];
}