Merge remote-tracking branch 'lass/master'

This commit is contained in:
makefu 2018-09-26 11:11:06 +02:00
commit d7ecf1abdc
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
19 changed files with 95 additions and 42 deletions

View File

@ -4,7 +4,7 @@ with import <stockholm/lib>;
{ {
krebs.Reaktor.retiolum = { krebs.Reaktor.retiolum = {
nickname = "Reaktor|lass"; nickname = "Reaktor|lass";
channels = [ "#xxx" ]; channels = [ "#noise" "#xxx" ];
extraEnviron = { extraEnviron = {
REAKTOR_HOST = "irc.r"; REAKTOR_HOST = "irc.r";
}; };

View File

@ -122,6 +122,7 @@ let
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
environment = { environment = {
GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
PYTHONPATH = "${pkgs.Reaktor}/lib/python3.6/site-packages";
REAKTOR_NICKNAME = botcfg.nickname; REAKTOR_NICKNAME = botcfg.nickname;
REAKTOR_DEBUG = (if botcfg.debug then "True" else "False"); REAKTOR_DEBUG = (if botcfg.debug then "True" else "False");
REAKTOR_CHANNELS = lib.concatStringsSep "," botcfg.channels; REAKTOR_CHANNELS = lib.concatStringsSep "," botcfg.channels;

View File

@ -53,7 +53,7 @@ in {
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
system.activationScripts.announce-activation = '' system.activationScripts.announce-activation = stringAfter [ "etc" ] ''
${announce-activation} ${announce-activation}
''; '';
}; };

View File

@ -82,6 +82,7 @@ let
irc = words.IRC("${cfg.irc.server}", "${cfg.irc.nick}", irc = words.IRC("${cfg.irc.server}", "${cfg.irc.nick}",
channels=${builtins.toJSON cfg.irc.channels}, channels=${builtins.toJSON cfg.irc.channels},
notify_events={ notify_events={
'started': 1,
'success': 1, 'success': 1,
'failure': 1, 'failure': 1,
'exception': 1, 'exception': 1,

View File

@ -160,8 +160,6 @@ let
# TODO: maybe also prepare buildbot.tac? # TODO: maybe also prepare buildbot.tac?
ExecStartPre = pkgs.writeDash "buildbot-master-init" '' ExecStartPre = pkgs.writeDash "buildbot-master-init" ''
set -efux set -efux
#remove garbage from old versions
rm -rf ${workdir}
mkdir -p ${workdir}/info mkdir -p ${workdir}/info
cp ${buildbot-slave-init} ${workdir}/buildbot.tac cp ${buildbot-slave-init} ${workdir}/buildbot.tac
echo ${contact} > ${workdir}/info/admin echo ${contact} > ${workdir}/info/admin

View File

@ -183,6 +183,11 @@ let
to = concatMapStringsSep "," (getAttr "mail") (toList to); to = concatMapStringsSep "," (getAttr "mail") (toList to);
}; };
in mapAttrsToList format (with config.krebs.users; let in mapAttrsToList format (with config.krebs.users; let
brain-ml = [
lass
makefu
tv
];
eloop-ml = spam-ml ++ [ ciko ]; eloop-ml = spam-ml ++ [ ciko ];
spam-ml = [ spam-ml = [
lass lass
@ -192,6 +197,7 @@ let
ciko.mail = "ciko@slash16.net"; ciko.mail = "ciko@slash16.net";
in { in {
"anmeldung@eloop.org" = eloop-ml; "anmeldung@eloop.org" = eloop-ml;
"brain@krebsco.de" = brain-ml;
"cfp@eloop.org" = eloop-ml; "cfp@eloop.org" = eloop-ml;
"kontakt@eloop.org" = eloop-ml; "kontakt@eloop.org" = eloop-ml;
"root@eloop.org" = eloop-ml; "root@eloop.org" = eloop-ml;

View File

@ -58,7 +58,7 @@ let
}; };
}; };
config.activate = let config.activate = let
src = pkgs.execve config.name { src = pkgs.exec config.name {
inherit (config) envp filename; inherit (config) envp filename;
}; };
dst = "${wrapperDir}/${config.name}"; dst = "${wrapperDir}/${config.name}";

View File

@ -120,7 +120,7 @@ rec {
url-title = (buildSimpleReaktorPlugin "url-title" { url-title = (buildSimpleReaktorPlugin "url-title" {
pattern = "^.*(?P<args>http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+).*$$"; pattern = "^.*(?P<args>http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+).*$$";
path = with pkgs; [ curl perl ]; path = with pkgs; [ curl perl ];
script = pkgs.writePython3 "url-title" [ "beautifulsoup4" "lxml" ] '' script = pkgs.writePython3 "url-title" { deps = with pkgs.python3Packages; [ beautifulsoup4 lxml ]; } ''
import cgi import cgi
import sys import sys
import urllib.request import urllib.request

View File

@ -8,9 +8,19 @@ import shelve
from os import environ from os import environ
from os.path import join from os.path import join
from sys import argv from sys import argv
from time import sleep
import re import re
d = shelve.open(join(environ['state_dir'], 'sed-plugin.shelve'), writeback=True) # try to open the shelve file until it succeeds
while True:
try:
d = shelve.open(
join(environ['state_dir'], 'sed-plugin.shelve'),
writeback=True
)
break
except: # noqa: E722
sleep(0.2)
usr = environ['_from'] usr = environ['_from']

View File

@ -2,7 +2,7 @@
python2Packages.buildPythonApplication rec { python2Packages.buildPythonApplication rec {
name = "buildbot-classic-${version}"; name = "buildbot-classic-${version}";
version = "0.8.17"; version = "0.8.18";
namePrefix = ""; namePrefix = "";
patches = []; patches = [];
@ -10,7 +10,7 @@ python2Packages.buildPythonApplication rec {
owner = "krebs"; owner = "krebs";
repo = "buildbot-classic"; repo = "buildbot-classic";
rev = version; rev = version;
sha256 = "0yn0n37rs2bhz9q0simnvyzz5sfrpqhbdm6pdj6qk7sab4y6xbq8"; sha256 = "0b4y3n9zd2gdy8xwk1vpvs4n9fbg72vi8mx4ydgijwngcmdqkjmq";
}; };
postUnpack = "sourceRoot=\${sourceRoot}/master"; postUnpack = "sourceRoot=\${sourceRoot}/master";

View File

@ -1,6 +1,6 @@
{ writeDashBin, bepasty-client-cli }: { writeDashBin, bepasty-client-cli }:
# TODO use `execve` instead? # TODO use `pkgs.exec` instead?
writeDashBin "krebspaste" '' writeDashBin "krebspaste" ''
exec ${bepasty-client-cli}/bin/bepasty-cli -L 1m --url http://paste.r "$@" | sed '$ s/$/\/+inline/g' exec ${bepasty-client-cli}/bin/bepasty-cli -L 1m --url http://paste.r "$@" | sed '$ s/$/\/+inline/g'
'' ''

View File

@ -2,7 +2,7 @@
krops = builtins.fetchGit { krops = builtins.fetchGit {
url = https://cgit.krebsco.de/krops/; url = https://cgit.krebsco.de/krops/;
rev = "4e466eaf05861b47365c5ef46a31a188b70f3615"; rev = "c46166d407c7d246112f13346621a3fbdb25889e";
}; };
lib = import "${krops}/lib"; lib = import "${krops}/lib";

View File

@ -1,7 +1,7 @@
{ {
"url": "https://github.com/NixOS/nixpkgs-channels", "url": "https://github.com/NixOS/nixpkgs-channels",
"rev": "a37638d46706610d12c9747614fd1b8f8d35ad48", "rev": "d16a7abceb72aac85e0deb8c45fbcb7127baf628",
"date": "2018-08-30T21:03:26+02:00", "date": "2018-09-20T18:31:51-05:00",
"sha256": "0rsdkk4z7pkqr2mw0pq7i6fkqs7gbi5kral3c8smm9bw104sn8v7", "sha256": "0byf6rlwwy70v2sdfmv7mnwd0kvxmlq0pi8ijghg0mcfhcqibgh7",
"fetchSubmodules": true "fetchSubmodules": true
} }

View File

@ -16,6 +16,7 @@
<stockholm/lass/2configs/bitcoin.nix> <stockholm/lass/2configs/bitcoin.nix>
<stockholm/lass/2configs/backup.nix> <stockholm/lass/2configs/backup.nix>
<stockholm/lass/2configs/wine.nix> <stockholm/lass/2configs/wine.nix>
<stockholm/lass/2configs/blue-host.nix>
]; ];
krebs.build.host = config.krebs.hosts.icarus; krebs.build.host = config.krebs.hosts.icarus;

View File

@ -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 = { krebs.Reaktor.playlist = {
nickname = "the_playlist|r"; nickname = "the_playlist|r";
channels = [ channels = [
@ -157,27 +181,40 @@ in {
}) })
]; ];
}; };
services.nginx.virtualHosts."lassul.us".locations."/the_playlist".extraConfig = let services.nginx = {
html = pkgs.writeText "index.html" '' enable = true;
<!DOCTYPE html> virtualHosts."radio.lassul.us" = {
<html lang="en"> forceSSL = true;
<head> enableACME = true;
<meta charset="utf-8"> locations."/".extraConfig = ''
<title>lassulus playlist</title> proxy_pass http://localhost:8000;
</head> '';
<body> locations."/recent".extraConfig = ''
<div style="display:inline-block;margin:0px;padding:0px;overflow:hidden"> alias /tmp/played;
<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;"> virtualHosts."lassul.us".locations."/the_playlist".extraConfig = let
<audio controls autoplay="autoplay"><source src="http://lassul.us:8000/radio.ogg" type="audio/ogg">Your browser does not support the audio element.</audio> html = pkgs.writeText "index.html" ''
</div> <!DOCTYPE html>
<!-- page content --> <html lang="en">
</body> <head>
</html> <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};
'';
} }

View File

@ -65,7 +65,7 @@ with import <stockholm/lib>;
}) })
(buildSimpleReaktorPlugin "random-unicorn-porn" { (buildSimpleReaktorPlugin "random-unicorn-porn" {
pattern = "^!rup$$"; pattern = "^!rup$$";
script = pkgs.writePython2 "rup" [] '' script = pkgs.writePython2 "rup" {} ''
t1 = """ t1 = """
_. _.
;=',_ () ;=',_ ()

View File

@ -91,7 +91,7 @@ in {
script = pkgs.writeBash "test" '' script = pkgs.writeBash "test" ''
echo "hello world" echo "hello world"
''; '';
#script = pkgs.execve "ddate-wrapper" { #script = pkgs.exec "ddate-wrapper" {
# filename = "${pkgs.ddate}/bin/ddate"; # filename = "${pkgs.ddate}/bin/ddate";
# argv = []; # argv = [];
#}; #};

@ -1 +1 @@
Subproject commit 5d79992262e8f16a3efa985375be74abea3bb392 Subproject commit c27a9416e8ee04d708b11b48f8cf1a055c0cc079

View File

@ -2,9 +2,7 @@ with import <stockholm/lib>;
{ config, pkgs, ... }: { { config, pkgs, ... }: {
imports = [ imports = [
<stockholm/krebs> <stockholm/tv>
<stockholm/tv/2configs>
<stockholm/tv/3modules>
<stockholm/tv/2configs/exim-retiolum.nix> <stockholm/tv/2configs/exim-retiolum.nix>
<stockholm/tv/2configs/retiolum.nix> <stockholm/tv/2configs/retiolum.nix>
]; ];
@ -57,6 +55,7 @@ with import <stockholm/lib>;
gimp gimp
iptables iptables
libreoffice libreoffice
plasma-pa
(pkgs.pidgin-with-plugins.override { (pkgs.pidgin-with-plugins.override {
plugins = [ pkgs.pidginotr ]; plugins = [ pkgs.pidginotr ];
}) })