diff options
author | jeschli <jeschli@gmail.com> | 2018-09-25 19:56:06 +0200 |
---|---|---|
committer | jeschli <jeschli@gmail.com> | 2018-09-25 19:56:06 +0200 |
commit | 8834d1a9ff6eddfc36e3ad07b7f93805b3212b3f (patch) | |
tree | 9ce300976ec88d90e5c5c9030111d890dcf5683e /lass/2configs | |
parent | f922d5947acc3151619ec06962197a800d3138eb (diff) | |
parent | a374a452112ba962ab90e45b6b0f27b3a1330e4f (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'lass/2configs')
-rw-r--r-- | lass/2configs/blue.nix | 2 | ||||
-rw-r--r-- | lass/2configs/git.nix | 8 | ||||
-rw-r--r-- | lass/2configs/radio.nix | 81 | ||||
-rw-r--r-- | lass/2configs/reaktor-coders.nix | 2 | ||||
-rw-r--r-- | lass/2configs/websites/lassulus.nix | 2 |
5 files changed, 71 insertions, 24 deletions
diff --git a/lass/2configs/blue.nix b/lass/2configs/blue.nix index 16c63ff38..68f2256cf 100644 --- a/lass/2configs/blue.nix +++ b/lass/2configs/blue.nix @@ -11,6 +11,8 @@ with (import <stockholm/lib>); environment.systemPackages = with pkgs; [ ag + brain + dic nmap git-preview ]; diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix index 300637ff8..97def9df3 100644 --- a/lass/2configs/git.nix +++ b/lass/2configs/git.nix @@ -34,6 +34,10 @@ let rules = concatMap make-rules (attrValues repos); public-repos = mapAttrs make-public-repo { + Reaktor = { + cgit.desc = "Reaktor IRC bot"; + cgit.section = "software"; + }; buildbot-classic = { cgit.desc = "fork of buildbot"; cgit.section = "software"; @@ -54,6 +58,10 @@ let cgit.desc = "take a rss feed and a timeout and print it to stdout"; cgit.section = "software"; }; + nix-writers = { + cgit.desc = "high level writers for nix"; + cgit.section = "software"; + }; nixpkgs = { cgit.desc = "nixpkgs fork"; cgit.section = "configuration"; diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index a83d51f1d..fb7ae01b6 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -131,6 +131,30 @@ in { }; }; + systemd.services.radio-recent = let + recentlyPlayed = pkgs.writeDash "recentlyPlayed" '' + LIMIT=1000 #how many tracks to keep in the history + HISTORY_FILE=/tmp/played + while :; do + ${pkgs.mpc_cli}/bin/mpc idle player > /dev/null + ${pkgs.mpc_cli}/bin/mpc current -f %file% + done | while read track; do + echo "$(date -Is)" "$track" | tee -a "$HISTORY_FILE" + echo "$(tail -$LIMIT "$HISTORY_FILE")" > "$HISTORY_FILE" + done + ''; + in { + description = "radio recently played"; + after = [ "mpd.service" "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + restartIfChanged = true; + + serviceConfig = { + ExecStart = recentlyPlayed; + }; + }; + krebs.Reaktor.playlist = { nickname = "the_playlist|r"; channels = [ @@ -157,27 +181,40 @@ in { }) ]; }; - services.nginx.virtualHosts."lassul.us".locations."/the_playlist".extraConfig = let - html = pkgs.writeText "index.html" '' - <!DOCTYPE html> - <html lang="en"> - <head> - <meta charset="utf-8"> - <title>lassulus playlist</title> - </head> - <body> - <div style="display:inline-block;margin:0px;padding:0px;overflow:hidden"> - <iframe src="https://kiwiirc.com/client/irc.freenode.org/?nick=kiwi_test|?&theme=cli#the_playlist" frameborder="0" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:95%;width:100%;position:absolute;top:0px;left:0px;right:0px;bottom:0px" height="95%" width="100%"></iframe> - </div> - <div style="position:absolute;bottom:1px;display:inline-block;background-color:red;"> - <audio controls autoplay="autoplay"><source src="http://lassul.us:8000/radio.ogg" type="audio/ogg">Your browser does not support the audio element.</audio> - </div> - <!-- page content --> - </body> - </html> + services.nginx = { + enable = true; + virtualHosts."radio.lassul.us" = { + forceSSL = true; + enableACME = true; + locations."/".extraConfig = '' + proxy_pass http://localhost:8000; + ''; + locations."/recent".extraConfig = '' + alias /tmp/played; + ''; + }; + virtualHosts."lassul.us".locations."/the_playlist".extraConfig = let + html = pkgs.writeText "index.html" '' + <!DOCTYPE html> + <html lang="en"> + <head> + <meta charset="utf-8"> + <title>lassulus playlist</title> + </head> + <body> + <div style="display:inline-block;margin:0px;padding:0px;overflow:hidden"> + <iframe src="https://kiwiirc.com/client/irc.freenode.org/?nick=kiwi_test|?&theme=cli#the_playlist" frameborder="0" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:95%;width:100%;position:absolute;top:0px;left:0px;right:0px;bottom:0px" height="95%" width="100%"></iframe> + </div> + <div style="position:absolute;bottom:1px;display:inline-block;background-color:red;"> + <audio controls autoplay="autoplay"><source src="http://lassul.us:8000/radio.ogg" type="audio/ogg">Your browser does not support the audio element.</audio> + </div> + <!-- page content --> + </body> + </html> + ''; + in '' + default_type "text/html"; + alias ${html}; ''; - in '' - default_type "text/html"; - alias ${html}; - ''; + }; } diff --git a/lass/2configs/reaktor-coders.nix b/lass/2configs/reaktor-coders.nix index 9365582b8..44d8984d7 100644 --- a/lass/2configs/reaktor-coders.nix +++ b/lass/2configs/reaktor-coders.nix @@ -65,7 +65,7 @@ with import <stockholm/lib>; }) (buildSimpleReaktorPlugin "random-unicorn-porn" { pattern = "^!rup$$"; - script = pkgs.writePython2 "rup" [] '' + script = pkgs.writePython2 "rup" {} '' t1 = """ _. ;=',_ () diff --git a/lass/2configs/websites/lassulus.nix b/lass/2configs/websites/lassulus.nix index 8f24fb212..4c29831a2 100644 --- a/lass/2configs/websites/lassulus.nix +++ b/lass/2configs/websites/lassulus.nix @@ -91,7 +91,7 @@ in { script = pkgs.writeBash "test" '' echo "hello world" ''; - #script = pkgs.execve "ddate-wrapper" { + #script = pkgs.exec "ddate-wrapper" { # filename = "${pkgs.ddate}/bin/ddate"; # argv = []; #}; |