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

28 lines
618 B
Nix
Raw Permalink Normal View History

2023-12-02 00:46:56 +01:00
{ 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
2023-12-02 00:46:56 +01:00
echo "Stopped wlsunset"
else
${systemctl} --user start wlsunset.service
2023-12-02 00:46:56 +01:00
echo "Started wlsunset"
fi
'';
in
2023-05-31 04:53:44 +02:00
{
services.wlsunset = {
enable = true;
2023-07-17 16:50:07 +02:00
systemdTarget = "hyprland-session.target";
2023-05-31 04:53:44 +02:00
# Random Netherlands coordinates
latitude = "53.2";
longitude = "6.5";
};
home.packages = [ wlsunset-toggle ];
2023-05-31 04:53:44 +02:00
}