From 4144cff1a1c4c6b90cb85f9b859794c1570df3e3 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 24 Apr 2017 23:21:07 +0200 Subject: k 3 m: bump x to 4 cores --- krebs/3modules/makefu/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/3modules/makefu/default.nix b/krebs/3modules/makefu/default.nix index cef6a4fd6..6b32fc38a 100644 --- a/krebs/3modules/makefu/default.nix +++ b/krebs/3modules/makefu/default.nix @@ -173,7 +173,7 @@ with import ; }; }; x = { - cores = 2; + cores = 4; nets = { retiolum = { ip4.addr = "10.243.0.91"; -- cgit v1.2.3 From 96fcce0e7c95460ce55ba644cab60580547a2981 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 24 Apr 2017 23:21:28 +0200 Subject: m 1 gum: add newsbot deployment --- makefu/1systems/gum.nix | 1 + makefu/2configs/deployment/newsbot.nix | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 makefu/2configs/deployment/newsbot.nix diff --git a/makefu/1systems/gum.nix b/makefu/1systems/gum.nix index 3186f8887..4850aedc1 100644 --- a/makefu/1systems/gum.nix +++ b/makefu/1systems/gum.nix @@ -27,6 +27,7 @@ in { ## Web ../2configs/deployment/owncloud.nix + ../2configs/deployment/newsbot.nix ../2configs/nginx/share-download.nix ../2configs/nginx/euer.test.nix ../2configs/nginx/euer.wiki.nix diff --git a/makefu/2configs/deployment/newsbot.nix b/makefu/2configs/deployment/newsbot.nix new file mode 100644 index 000000000..748803447 --- /dev/null +++ b/makefu/2configs/deployment/newsbot.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +let + newsfile = pkgs.writeText "feeds" '' + nixoswiki-bot|https://github.com/Mic92/nixos-wiki/wiki.atom|#krebs + ''; +in { + environment.systemPackages = [ + pkgs.newsbot-js + ]; + krebs.newsbot-js = { + enable = true; + ircServer = "chat.freenode.net"; + feeds = newsfile; + urlShortenerHost = "go"; + urlShortenerPort = "80"; + }; +} -- cgit v1.2.3 From 9b813fdf07573d2d7099f8d494b7724abe1c0dc7 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 24 Apr 2017 23:22:13 +0200 Subject: m 2 torrent: mkdefault download --- makefu/2configs/torrent.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefu/2configs/torrent.nix b/makefu/2configs/torrent.nix index 69d40094f..85d2e6c67 100644 --- a/makefu/2configs/torrent.nix +++ b/makefu/2configs/torrent.nix @@ -20,7 +20,7 @@ in { download = { name = "download"; home = dl-dir; - uid = genid "download"; + uid = mkDefault (genid "download"); createHome = true; useDefaultShell = true; group = "download"; @@ -39,7 +39,7 @@ in { users.extraGroups = { download = { - gid = genid "download"; + gid = lib.mkDefault (genid "download"); members = [ config.krebs.build.user.name "download" -- cgit v1.2.3 From b1cad2a6497ac285c7c1a11d5bdeadb64e6bc2a5 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 26 Apr 2017 14:42:52 +0200 Subject: m 2 wiki-irc: add logstash config for github hook --- makefu/2configs/deployment/wiki-irc.nix | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 makefu/2configs/deployment/wiki-irc.nix diff --git a/makefu/2configs/deployment/wiki-irc.nix b/makefu/2configs/deployment/wiki-irc.nix new file mode 100644 index 000000000..73b85d821 --- /dev/null +++ b/makefu/2configs/deployment/wiki-irc.nix @@ -0,0 +1,49 @@ +{ pkgs, lib, ... }: + +with lib; +let + port = 18872; +in { + services.logstash = { + enable = true; + inputConfig = '' + http { + port => ${toString port} + host => "127.0.0.1" + } + ''; + filterConfig = '' + if ([pages]) { + ruby { + code => ' + o = "" + event["pages"].each { |p| o = o + "\"" + p["title"] + "\" " + p["action"] +" by "+ event["sender"]["login"]+" " +p["html_url"] + "/_compare/" + p["sha"] + "\n" } + event["output"] = o + ' + } + } + ''; + outputConfig = '' + file { path => "/tmp/logs.json" codec => "json_lines" } + if [output] { + irc { + channels => [ "#krebs" ] + host => "irc.freenode.net" + nick => "nixos-wiki" + format => "%{output}" + } + } + ''; + plugins = [ ]; + }; + + services.nginx = { + enable = lib.mkDefault true; + virtualHosts."ghook.krebsco.de" = { + locations."/".proxyPass = "http://localhost:${toString port}/"; + enableSSL = true; + enableACME = true; + forceSSL = true; + }; + }; +} -- cgit v1.2.3