From 927be66a48008620481e5e7e50d221251982f751 Mon Sep 17 00:00:00 2001 From: Aditya Date: Wed, 11 Sep 2024 10:27:14 +0530 Subject: [PATCH] add README --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..89a7e63 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# Monitor +Report website's status + +## Usage +### Oneshot +```nix +nix run github:akr2002/monitor +``` +### Persistent +Add the following to your `home.nix` +```nix +systemd.user.timers.monitor = { + Install.WantedBy = [ "timers.target" ]; + Timer = { + OnBootSec = "1m"; + OnUnitActiveSec = "1m"; + Unit = "monitor.service"; + }; +}; +systemd.user.services.monitor = { + Unit = { + Description = "A script to monitor websites."; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + Service = { + ExecStart = "${inputs.monitor.packages.${pkgs.system}.default}/bin/monitor"; + }; +}; +``` +Start: +```bash +systemctl --user start mointor.timer +```