diff options
author | tv <tv@krebsco.de> | 2021-05-20 11:08:58 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2021-05-20 11:08:58 +0200 |
commit | 5460255668f43ad1486c6ce0261aebe06d64857a (patch) | |
tree | 75e4f4b71c5636bb405b9ddbb30fdbeeffb4eced /makefu/2configs/home/ham/signal-rest | |
parent | a5d9c02a937f577c0dc25b8e46142f9c9b1db534 (diff) | |
parent | da975042c505a2fa693677cbd10d8245c17b3570 (diff) |
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'makefu/2configs/home/ham/signal-rest')
-rw-r--r-- | makefu/2configs/home/ham/signal-rest/default.nix | 20 | ||||
-rw-r--r-- | makefu/2configs/home/ham/signal-rest/hass.nix | 20 | ||||
-rw-r--r-- | makefu/2configs/home/ham/signal-rest/pkg.nix | 25 | ||||
-rw-r--r-- | makefu/2configs/home/ham/signal-rest/service.nix | 18 |
4 files changed, 67 insertions, 16 deletions
diff --git a/makefu/2configs/home/ham/signal-rest/default.nix b/makefu/2configs/home/ham/signal-rest/default.nix index 250a3596d..4eac41ba8 100644 --- a/makefu/2configs/home/ham/signal-rest/default.nix +++ b/makefu/2configs/home/ham/signal-rest/default.nix @@ -1,18 +1,6 @@ - -let - port = 8631; - image = "bbernhard/signal-cli-rest-api:latest"; - config = "/var/lib/signal-cli-config"; -in { - systemd.tmpfiles.rules = [ - "d ${config} docker docker - -" +{ + imports = [ + ./service.nix + ./hass.nix ]; - state = [ config ]; - virtualisation.oci-containers.containers.signal-rest = { - image = image; - ports = [ "127.0.0.1:${toString port}:8080" ]; - volumes = [ - "${config}:/home/.local/share/signal-cli" - ]; - }; } diff --git a/makefu/2configs/home/ham/signal-rest/hass.nix b/makefu/2configs/home/ham/signal-rest/hass.nix new file mode 100644 index 000000000..284be3320 --- /dev/null +++ b/makefu/2configs/home/ham/signal-rest/hass.nix @@ -0,0 +1,20 @@ +let + inherit (import <secrets/signal/messenger.nix>) number home felix; +in { + services.home-assistant.config.notify = [ + { + name = "signal_home"; + platform = "signal_messenger"; + url = "http://127.0.0.1:8631"; + inherit number ; + recipients = [ home ]; + } + { + name = "signal_felix"; + platform = "signal_messenger"; + url = "http://127.0.0.1:8631"; + inherit number; + recipients = [ felix ]; + } + ]; +} diff --git a/makefu/2configs/home/ham/signal-rest/pkg.nix b/makefu/2configs/home/ham/signal-rest/pkg.nix new file mode 100644 index 000000000..165d642af --- /dev/null +++ b/makefu/2configs/home/ham/signal-rest/pkg.nix @@ -0,0 +1,25 @@ +{ lib +, buildPythonPackage +, fetchPypi +}: + +buildPythonPackage rec { + pname = "pysignalclirestapi"; + version = "0.3.14"; + + # disabled = ; # requires python version >=2.7 + + src = fetchPypi { + inherit pname version; + sha256 = "6f3626b594a53c4161dfc67ea7a3b23d62c8fe8cb404a909496118aeefa79cd0"; + }; + + doCheck = false; + + meta = with lib; { + description = "Small python library for the Signal Cli REST API"; + homepage = https://github.com/bbernhard/pysignalclirestapi; + #license = licenses.; + # maintainers = [ maintainers. ]; + }; +} diff --git a/makefu/2configs/home/ham/signal-rest/service.nix b/makefu/2configs/home/ham/signal-rest/service.nix new file mode 100644 index 000000000..250a3596d --- /dev/null +++ b/makefu/2configs/home/ham/signal-rest/service.nix @@ -0,0 +1,18 @@ + +let + port = 8631; + image = "bbernhard/signal-cli-rest-api:latest"; + config = "/var/lib/signal-cli-config"; +in { + systemd.tmpfiles.rules = [ + "d ${config} docker docker - -" + ]; + state = [ config ]; + virtualisation.oci-containers.containers.signal-rest = { + image = image; + ports = [ "127.0.0.1:${toString port}:8080" ]; + volumes = [ + "${config}:/home/.local/share/signal-cli" + ]; + }; +} |