mirror of
https://github.com/kmein/niveum
synced 2026-03-19 19:41:08 +01:00
Compare commits
5 Commits
f1ce023eca
...
742018dab0
| Author | SHA1 | Date | |
|---|---|---|---|
| 742018dab0 | |||
| 8a8a4aae67 | |||
| e521a82246 | |||
| 78f490cdfb | |||
| b5905f886a |
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"url": "https://github.com/NixOS/nixpkgs.git",
|
||||
"rev": "61f412a75ff77d32c9cc701742bd146cce9cab42",
|
||||
"date": "2021-05-20T13:14:07+02:00",
|
||||
"path": "/nix/store/hnw7m7k3g7q8sffhray5rqminzjq0pps-nixpkgs",
|
||||
"sha256": "1c8mqf3cph5ic33k8sanpyvlf2g5wl9wfqhp0gcrdp0zg3w6adk0",
|
||||
"rev": "ed9cff9073aabc3f40f95b987a60d55256c0e200",
|
||||
"date": "2021-05-25T11:47:06+02:00",
|
||||
"path": "/nix/store/cmkhh7w2w92w6a2nxl02wp4jns84bs64-nixpkgs",
|
||||
"sha256": "0byz1bfx85sjkkd4mbm350hbdniwyw2fskgy9ni0hld7jlbzwxs4",
|
||||
"fetchSubmodules": false,
|
||||
"deepClone": false,
|
||||
"leaveDotGit": false
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"url": "https://github.com/NixOS/nixpkgs.git",
|
||||
"rev": "33824cdf8e4fec30c5b9ddc91b18991c3c375227",
|
||||
"date": "2021-05-18T19:08:44-04:00",
|
||||
"path": "/nix/store/s3f1q2a5hn60jdnz8h66z7yahrmzifin-nixpkgs",
|
||||
"sha256": "1sad0x998k3iid2vp57kv4skvf90yh4gbs61dv3p45c2qi3sql46",
|
||||
"rev": "ac60476ed94fd5424d9f3410c438825f793a8cbb",
|
||||
"date": "2021-05-22T23:14:25+02:00",
|
||||
"path": "/nix/store/fbqn4pcs6bmamwvkqk2r8py5h4i7idqa-nixpkgs",
|
||||
"sha256": "1dlvpdsy5v09c7rj5f7xgakyj722yqr4415davjpcmrk4n5kw76v",
|
||||
"fetchSubmodules": false,
|
||||
"deepClone": false,
|
||||
"leaveDotGit": false
|
||||
|
||||
@@ -62,6 +62,7 @@ in {
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
texlive.combined.scheme-full
|
||||
latexrun
|
||||
(aspellWithDicts (dict: [ dict.de dict.en dict.en-computers ]))
|
||||
haskellPackages.pandoc-citeproc
|
||||
nur.repos.kmein.text2pdf
|
||||
|
||||
@@ -36,34 +36,32 @@ in {
|
||||
/set weechat.color.chat_nick_colors "${lib.concatMapStringsSep "," toString coolColors}"
|
||||
|
||||
/server add hackint irc.hackint.org/6697 -ipv6 -ssl
|
||||
/server add freenode chat.freenode.org/6697 -ssl
|
||||
/server add libera irc.libera.chat/6697 -ssl
|
||||
/server add irc.r irc.r
|
||||
/server add news.r news.r
|
||||
/server add retiolum irc.r
|
||||
/server add news news.r
|
||||
|
||||
/alias add mod /quote omode $channel +o $nick
|
||||
|
||||
/relay add weechat 9000
|
||||
/set relay.network.password ${relayPassword}
|
||||
|
||||
/set irc.server.freenode.autojoin "#nixos,#nixos-de,#haskell"
|
||||
/set irc.server.hackint.autojoin "#hsmr,#krebs"
|
||||
/set irc.server.libera.autojoin "#flipdot,#fysi"
|
||||
/set irc.server.irc.r.autojoin "#xxx,#brockman,#flix"
|
||||
/set irc.server.news.r.autojoin "#cook,#drachengame,#oepnv,#kmeinung,#memes"
|
||||
/set irc.server.news.r.command "/oper aids balls"
|
||||
/set logger.level.irc.news.r.#all 0
|
||||
/set irc.server.hackint.autojoin "#hsmr,#krebs,#nixos,#the_playlist"
|
||||
/set irc.server.libera.autojoin "#flipdot,#haskell,#nixos,#fysi"
|
||||
/set irc.server.retiolum.autojoin "#xxx,#brockman,#flix"
|
||||
/set irc.server.news.autojoin "#cook,#drachengame,#oepnv,#kmeinung,#memes"
|
||||
/set irc.server.news.command "/oper aids balls"
|
||||
/set logger.level.irc.news.#all 0
|
||||
|
||||
/filter addreplace corona irc.news.r.* * [kc]orona|[kc]ovid|virus|lockdown|va[kc][sc]in|mutante|mutation|impf|pandemi|κορ[ωο]ν[αο]ϊό|корона|expert|infe[ck]tion|in[cz]iden[cz]|sars-cov
|
||||
/filter addreplace corona irc.news.* * [kc]orona|[kc]ovid|virus|lockdown|va[kc][sc]in|mutante|mutation|impf|pandemi|κορ[ωο]ν[αο]ϊό|корона|expert|infe[ck]tion|in[cz]iden[cz]|sars-cov
|
||||
/filter addreplace joinquit * irc_join,irc_part,irc_quit *
|
||||
/filter addreplace playlist_topic irc.*.#the_playlist irc_topic *
|
||||
|
||||
/set irc.look.server_buffer independent
|
||||
|
||||
/connect freenode
|
||||
/connect libera
|
||||
/connect hackint
|
||||
/connect irc.r
|
||||
/connect news.r
|
||||
/connect retiolum
|
||||
/connect news
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -128,11 +128,7 @@ in rec {
|
||||
packages = [ pkgs.curl pkgs.gnused pkgs.pandoc pkgs.man ];
|
||||
};
|
||||
|
||||
playlist = wrapScript {
|
||||
name = "pls";
|
||||
script = ./playlist.sh;
|
||||
packages = [ pkgs.curl pkgs.jq ];
|
||||
};
|
||||
playlist = import ./pls.nix { inherit pkgs; };
|
||||
|
||||
favicon = wrapScript {
|
||||
packages = [ pkgs.imagemagick ];
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
send_irc() {
|
||||
echo "
|
||||
USER $USER $(hostname) tolmoon $USER
|
||||
NICK musikkritiker
|
||||
JOIN #the_playlist
|
||||
PRIVMSG #the_playlist :$*
|
||||
QUIT
|
||||
" | nc irc.freenode.net 6667 >/dev/null
|
||||
}
|
||||
|
||||
good="what a banger
|
||||
ooh i love this song
|
||||
this is top notch stuff!
|
||||
nice!
|
||||
noice!
|
||||
yesss!
|
||||
cool song!
|
||||
i like this
|
||||
that just sounds awesome!
|
||||
that's a good song!
|
||||
👍"
|
||||
|
||||
bad="how can anyone listen to this?
|
||||
(╯°□°)╯ ┻━┻
|
||||
skip this!
|
||||
next, please! i'm suffering!
|
||||
that's just bad music
|
||||
nope
|
||||
that sucks!
|
||||
👎"
|
||||
|
||||
endpoint=prism.r:8001
|
||||
|
||||
case "$1" in
|
||||
good|like|cool|nice|noice|top|yass|yes|+)
|
||||
send_irc "$(echo "$good" | shuf -n1)" &
|
||||
curl -sS -XPOST "$endpoint/good"
|
||||
;;
|
||||
skip|next|bad|sucks|no|nope|flop|-)
|
||||
send_irc "$(echo "$bad" | shuf -n1)" &
|
||||
curl -sS -XPOST "$endpoint/skip"
|
||||
;;
|
||||
*)
|
||||
curl -sS -XGET "$endpoint/current" | jq
|
||||
;;
|
||||
esac
|
||||
wait
|
||||
61
packages/scripts/pls.nix
Executable file
61
packages/scripts/pls.nix
Executable file
@@ -0,0 +1,61 @@
|
||||
{ pkgs }:
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
|
||||
irc = {
|
||||
host = "irc.hackint.org";
|
||||
port = 6697;
|
||||
tls = true;
|
||||
channel = "#the_playlist";
|
||||
nick = "musikkritiker";
|
||||
};
|
||||
|
||||
playlistAPI = "prism.r:8001";
|
||||
|
||||
sendIRC = pkgs.writers.writeDash "send-irc" ''
|
||||
${pkgs.nur.repos.mic92.untilport}/bin/untilport ${irc.host} ${toString irc.port} && \
|
||||
${pkgs.nur.repos.mic92.irc-announce}/bin/irc-announce \
|
||||
${irc.host} ${toString irc.port} ${irc.nick} ${lib.escapeShellArg irc.channel} ${toString (if irc.tls then 1 else 0)} \
|
||||
"$*"
|
||||
'';
|
||||
|
||||
messages.good = [
|
||||
"what a banger"
|
||||
"ooh i love this song"
|
||||
"this is top notch stuff!"
|
||||
"nice!"
|
||||
"noice!"
|
||||
"yesss!"
|
||||
"cool song!"
|
||||
"i like this"
|
||||
"that just sounds awesome!"
|
||||
"that's a good song!"
|
||||
"👍"
|
||||
];
|
||||
messages.bad = [
|
||||
"how can anyone listen to this?"
|
||||
"(╯°□°)╯ ┻━┻"
|
||||
"skip this!"
|
||||
"next, please! i'm suffering!"
|
||||
"that's just bad music"
|
||||
"nope"
|
||||
"that sucks!"
|
||||
"👎"
|
||||
];
|
||||
in
|
||||
pkgs.writers.writeDashBin "pls" ''
|
||||
case "$1" in
|
||||
good|like|cool|nice|noice|top|yass|yes|+)
|
||||
# ${sendIRC} "$(echo "${lib.concatStringsSep "\n" messages.good}" | shuf -n1)" &
|
||||
${pkgs.curl}/bin/curl -sS -XPOST "${playlistAPI}/good"
|
||||
;;
|
||||
skip|next|bad|sucks|no|nope|flop|-)
|
||||
# ${sendIRC} "$(echo "${lib.concatStringsSep "\n" messages.bad}" | shuf -n1)" &
|
||||
${pkgs.curl}/bin/curl -sS -XPOST "${playlistAPI}/skip"
|
||||
;;
|
||||
*)
|
||||
${pkgs.curl}/bin/curl -sS -XGET "${playlistAPI}/current" | ${pkgs.jq}/bin/jq
|
||||
;;
|
||||
esac
|
||||
wait
|
||||
''
|
||||
Reference in New Issue
Block a user