aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/default.nix4
-rw-r--r--tools/sendsms/README.org8
-rw-r--r--tools/sendsms/default.nix15
3 files changed, 23 insertions, 4 deletions
diff --git a/tools/default.nix b/tools/default.nix
index 7a35b07..17ece45 100644
--- a/tools/default.nix
+++ b/tools/default.nix
@@ -1,4 +1,4 @@
-{ pkgs }:
+{ pkgs, naersk, ... }:
pkgs.lib.makeScope pkgs.newScope (pkgs: {
dnsupdate = pkgs.callPackage ./dnsupdate { };
@@ -10,4 +10,6 @@ pkgs.lib.makeScope pkgs.newScope (pkgs: {
ipconverter = pkgs.callPackage ./ipconverter { };
git-blame-stats = pkgs.callPackage ./git-blame-stats { };
+
+ sendsms = pkgs.callPackage ./sendsms { inherit naersk; };
})
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;
+}