diff options
Diffstat (limited to 'tools/sendsms')
-rw-r--r-- | tools/sendsms/README.org | 8 | ||||
-rw-r--r-- | tools/sendsms/default.nix | 15 |
2 files changed, 20 insertions, 3 deletions
diff --git a/tools/sendsms/README.org b/tools/sendsms/README.org index 8f3ffdd..755d086 100644 --- a/tools/sendsms/README.org +++ b/tools/sendsms/README.org @@ -2,7 +2,9 @@ A CLI to send SMS via [[https://console.twilio.com][twilio's API]]. -** Usage -The tool supports subcommands, which are profiles with predefined messages. +* Usage +The tool supports sub-commands, which are profiles with predefined messages. -For example, you can write a systemd unit that is triggered after a reboot to send an SMS with =sendsms reboot=. The SMS will contain the hostname and IP of a predefined interface. +For example, you can write a =systemd= unit that is triggered after a reboot to send an SMS with =sendsms reboot=. The SMS will contain the host's name and the IP of a predefined interface. +* Build +This can be build via =nix build .#tools.sendsms= from the root of the repository, or =cargo build= from inside the directory. diff --git a/tools/sendsms/default.nix b/tools/sendsms/default.nix new file mode 100644 index 0000000..6c9b79c --- /dev/null +++ b/tools/sendsms/default.nix @@ -0,0 +1,15 @@ +{ pkgs, naersk, ... }: + +naersk.lib."${pkgs.system}".buildPackage { + src = builtins.filterSource + (path: type: + type != "directory" || builtins.baseNameOf path != "target") + ./.; + + nativeBuildInputs = with pkgs; [ pkg-config ]; + buildInputs = with pkgs; [ openssl ]; + + remapPathPrefix = true; + doCheck = true; + copyLibs = true; +} |