diff options
author | lassulus <lass@lassul.us> | 2017-06-01 12:49:36 +0200 |
---|---|---|
committer | lassulus <lass@lassul.us> | 2017-06-01 12:49:36 +0200 |
commit | e50bc4f3eb3dac13bba4ae6158e839a52455c3c3 (patch) | |
tree | b3c1fc1f3e00312e92e4ab747c31839db665eebd /shared/2configs/shack/muell_caller.nix | |
parent | 73b073c3fe037f31e05828a1071c9b4b19f7a2ff (diff) | |
parent | 9e04d0132133840fba14aca194f18925e3f353d5 (diff) |
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'shared/2configs/shack/muell_caller.nix')
-rw-r--r-- | shared/2configs/shack/muell_caller.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/shared/2configs/shack/muell_caller.nix b/shared/2configs/shack/muell_caller.nix new file mode 100644 index 000000000..2d8d78e33 --- /dev/null +++ b/shared/2configs/shack/muell_caller.nix @@ -0,0 +1,41 @@ +{ config, lib, pkgs, ... }: + +with import <stockholm/lib>; +let + pkg = pkgs.stdenv.mkDerivation { + name = "muell_caller-2017-06-01"; + src = pkgs.fetchgit { + url = "https://github.com/shackspace/muell_caller/"; + rev = "bbd4009"; + sha256 = "1bfnfl2vdh0p5wzyz5p48qh04vvsg2445avg86fzhzragx25fqv0"; + }; + buildInputs = [ + (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ + docopt + requests2 + paramiko + python + ])) + ]; + installPhase = '' + install -m755 -D call.py $out/bin/call-muell + ''; + }; + cfg = "${toString <secrets>}/tell.json"; +in { + systemd.services.call_muell = { + description = "call muell"; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + User = "nobody"; # TODO separate user + ExecStartPre = pkgs.writeDash "call-muell-pre" '' + cp ${cfg} /tmp/tell.json + chown nobody /tmp/tell.json + ''; + ExecStart = "${pkg}/bin/call-muell --cfg /tmp/tell.json --mode mpd loop 60"; + Restart = "always"; + PrivateTmp = true; + PermissionsStartOnly = true; + }; + }; +} |