onebutton.r: add mpc-booter
This commit is contained in:
parent
14693d22bb
commit
179a0c8e86
@ -16,6 +16,36 @@
|
|||||||
services.nixosManual.enable = false;
|
services.nixosManual.enable = false;
|
||||||
services.journald.extraConfig = "SystemMaxUse=50M";
|
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;
|
krebs.build.host = config.krebs.hosts.onebutton;
|
||||||
# NixOS wants to enable GRUB by default
|
# NixOS wants to enable GRUB by default
|
||||||
|
@ -4,7 +4,7 @@ let
|
|||||||
nixpkgs = pkgs.fetchFromGitHub {
|
nixpkgs = pkgs.fetchFromGitHub {
|
||||||
owner = "nixos";
|
owner = "nixos";
|
||||||
repo = "nixpkgs-channels";
|
repo = "nixpkgs-channels";
|
||||||
rev = "6c064e6b"; # only binary cache for unstable arm6
|
rev = "nixos-unstable"; # only binary cache for unstable arm6
|
||||||
sha256 = "1rqzh475xn43phagrr30lb0fd292c1s8as53irihsnd5wcksnbyd";
|
sha256 = "1rqzh475xn43phagrr30lb0fd292c1s8as53irihsnd5wcksnbyd";
|
||||||
};
|
};
|
||||||
in import <stockholm/krebs/source.nix> {
|
in import <stockholm/krebs/source.nix> {
|
||||||
|
Loading…
Reference in New Issue
Block a user