summaryrefslogtreecommitdiffstats
path: root/krebs/1systems/onebutton/config.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-07-09 14:31:18 +0200
committerjeschli <jeschli@gmail.com>2018-07-09 14:31:18 +0200
commitd1c6baf00e98a0229fc7fd96874623efc8417b05 (patch)
treeeaba9481ed208af1086690a9c07ca948b047389a /krebs/1systems/onebutton/config.nix
parentb439342e7533e3f695db8a46576c54d180f56a58 (diff)
parentd6df7ae483b984b90bdc8d4540301ef394885a98 (diff)
Merge remote-tracking branch 'origin/staging/jeschli'
Diffstat (limited to 'krebs/1systems/onebutton/config.nix')
-rw-r--r--krebs/1systems/onebutton/config.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/krebs/1systems/onebutton/config.nix b/krebs/1systems/onebutton/config.nix
index dca00a206..b87aef5a3 100644
--- a/krebs/1systems/onebutton/config.nix
+++ b/krebs/1systems/onebutton/config.nix
@@ -16,6 +16,36 @@
services.nixosManual.enable = false;
services.journald.extraConfig = "SystemMaxUse=50M";
}
+ {
+ systemd.services.mpc-booter = let
+ mpc = "${pkgs.mpc_cli}/bin/mpc -h mpd.shack -p 6600";
+ url = "http://lassul.us:8000/radio.ogg";
+ say = pkgs.writeDash "say" ''
+ tmpfile=$(${pkgs.coreutils}/bin/mktemp)
+ echo "$@" > $tmpfile
+ ${pkgs.curl}/bin/curl -i -H "content-type: text/plain" -X POST -d "@$tmpfile" gobbelz.shack/say/
+ rm "$tmpfile"
+ '';
+ in {
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network-online.target" ];
+ serviceConfig = {
+ RemainAfterExit = "yes";
+ Type = "oneshot";
+ ExecStart = pkgs.writeDash "mpc-boot" ''
+ until ${mpc} stats;do
+ echo "waiting for mpd.shack to appear"
+ sleep 1
+ done
+ ${say} "Willkommen im Shack wertes Mitglied"
+
+ ${say} "Lassulus Super Radio wurde gestartet"
+ ${mpc} add ${url}
+ ${mpc} play
+ '';
+ };
+ };
+ }
];
krebs.build.host = config.krebs.hosts.onebutton;
# NixOS wants to enable GRUB by default