summaryrefslogtreecommitdiffstats
path: root/lass/2configs/radio.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2016-06-11 00:28:55 +0200
committerlassulus <lass@aidsballs.de>2016-06-11 01:26:03 +0200
commitcf0914ddcbc5f06fd82fb67acb885167c1145d21 (patch)
tree0ecb291b7c63c83e0e028ca2fb4d1d4db7c05058 /lass/2configs/radio.nix
parent91fe76414ad9fa217bc48c9e4ecd642dcbb38211 (diff)
l 2 radio: don't use systemds path
Diffstat (limited to 'lass/2configs/radio.nix')
-rw-r--r--lass/2configs/radio.nix11
1 files changed, 3 insertions, 8 deletions
diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix
index cb21cd446..19fe1408d 100644
--- a/lass/2configs/radio.nix
+++ b/lass/2configs/radio.nix
@@ -11,7 +11,7 @@ let
source-password = import <secrets/icecast-source-pw>;
add_random = pkgs.writeDashBin "add_random" ''
- mpc add "$(mpc ls | shuf -n1)"
+ ${pkgs.mpc_cli}/bin/mpc add "$(${pkgs.mpc_cli}/bin/mpc ls | shuf -n1)"
'';
skip_track = pkgs.writeDashBin "skip_track" ''
@@ -122,8 +122,8 @@ in {
LIMIT=$1 #in secconds
timeLeft () {
- playlistDuration=$(mpc --format '%time%' playlist | awk -F ':' 'BEGIN{t=0} {t+=$1*60+$2} END{print t}')
- currentTime=$(mpc status | awk '/^\[playing\]/ { sub(/\/.+/,"",$3); split($3,a,/:/); print a[1]*60+a[2] }')
+ playlistDuration=$(${pkgs.mpc_cli}/bin/mpc --format '%time%' playlist | ${pkgs.gawk}/bin/awk -F ':' 'BEGIN{t=0} {t+=$1*60+$2} END{print t}')
+ currentTime=$(${pkgs.mpc_cli}/bin/mpc status | ${pkgs.gawk}/bin/awk '/^\[playing\]/ { sub(/\/.+/,"",$3); split($3,a,/:/); print a[1]*60+a[2] }')
expr ''${playlistDuration:-0} - ''${currentTime:-0}
}
@@ -135,11 +135,6 @@ in {
description = "radio playlist autoadder";
after = [ "network.target" ];
- path = with pkgs; [
- gawk
- mpc_cli
- ];
-
restartIfChanged = true;
serviceConfig = {