summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/Reaktor.nix8
-rw-r--r--krebs/3modules/airdcpp.nix278
-rw-r--r--krebs/3modules/announce-activation.nix2
-rw-r--r--krebs/3modules/bepasty-server.nix12
-rw-r--r--krebs/3modules/buildbot/master.nix3
-rw-r--r--krebs/3modules/buildbot/slave.nix4
-rw-r--r--krebs/3modules/cachecache.nix171
-rw-r--r--krebs/3modules/charybdis.nix110
-rw-r--r--krebs/3modules/ci.nix38
-rw-r--r--krebs/3modules/default.nix148
-rw-r--r--krebs/3modules/dns.nix12
-rw-r--r--krebs/3modules/external/default.nix482
-rw-r--r--krebs/3modules/external/palo.nix84
-rw-r--r--krebs/3modules/external/ssh/Mic92.pub1
-rw-r--r--krebs/3modules/external/ssh/exco.pub1
-rw-r--r--krebs/3modules/external/ssh/kmein.pub1
-rw-r--r--krebs/3modules/external/ssh/raute.pub1
-rw-r--r--krebs/3modules/external/ssh/ulrich.pub1
-rw-r--r--krebs/3modules/external/tinc/justraute.pub14
-rw-r--r--krebs/3modules/external/tinc/palo.pub13
-rw-r--r--krebs/3modules/external/tinc/tpsw.pub8
-rw-r--r--krebs/3modules/fetchWallpaper.nix11
-rw-r--r--krebs/3modules/git.nix18
-rw-r--r--krebs/3modules/github-hosts-sync.nix2
-rw-r--r--krebs/3modules/github-known-hosts.nix40
-rw-r--r--krebs/3modules/hosts.nix94
-rw-r--r--krebs/3modules/jeschli/default.nix93
-rw-r--r--krebs/3modules/krebs/default.nix29
-rw-r--r--krebs/3modules/lass/default.nix568
-rw-r--r--krebs/3modules/lass/ssh/android.rsa2
-rw-r--r--krebs/3modules/makefu/default.nix1028
-rw-r--r--krebs/3modules/makefu/retiolum/cake.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/crapi.pub9
-rw-r--r--krebs/3modules/makefu/retiolum/filebitch.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/fileleech.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/filepimp.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/firecracker.pub14
-rw-r--r--krebs/3modules/makefu/retiolum/flap.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/gum.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/nukular.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/omo.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/sdev.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/senderechner.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/studio.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/tsp.pub13
-rw-r--r--krebs/3modules/makefu/retiolum/wbob.pub8
-rw-r--r--krebs/3modules/makefu/retiolum/x.pub8
-rw-r--r--krebs/3modules/makefu/ssh/makefu.android.pub1
-rw-r--r--krebs/3modules/makefu/ssh/makefu.bob.pub1
-rw-r--r--krebs/3modules/makefu/ssh/makefu.omo.pub1
-rw-r--r--krebs/3modules/makefu/ssh/makefu.remote-builder.pub1
-rw-r--r--krebs/3modules/makefu/ssh/makefu.tempx.pub1
-rw-r--r--krebs/3modules/makefu/ssh/makefu.tsp.pub1
-rw-r--r--krebs/3modules/makefu/ssh/makefu.vbob.pub1
-rw-r--r--krebs/3modules/makefu/ssh/makefu.x.pub1
-rw-r--r--krebs/3modules/makefu/sshd/cake.pub1
-rw-r--r--krebs/3modules/makefu/sshd/crapi.pub1
-rw-r--r--krebs/3modules/makefu/sshd/fileleech.pub1
-rw-r--r--krebs/3modules/makefu/sshd/firecracker.pub1
-rw-r--r--krebs/3modules/makefu/sshd/gum.pub1
-rw-r--r--krebs/3modules/makefu/sshd/omo.pub1
-rw-r--r--krebs/3modules/makefu/sshd/sdev.pub1
-rw-r--r--krebs/3modules/makefu/sshd/studio.pub1
-rw-r--r--krebs/3modules/makefu/sshd/wbob.pub1
-rw-r--r--krebs/3modules/makefu/sshd/x.pub1
-rw-r--r--krebs/3modules/makefu/wiregrill/gum.pub1
-rw-r--r--krebs/3modules/makefu/wiregrill/x.pub1
-rw-r--r--krebs/3modules/mb/default.nix73
-rw-r--r--krebs/3modules/nin/default.nix111
-rw-r--r--krebs/3modules/per-user.nix2
-rw-r--r--krebs/3modules/permown.nix102
-rw-r--r--krebs/3modules/power-action.nix3
-rw-r--r--krebs/3modules/reaktor2.nix75
-rw-r--r--krebs/3modules/realwallpaper.nix185
-rw-r--r--krebs/3modules/setuid.nix6
-rw-r--r--krebs/3modules/shadow.nix79
-rw-r--r--krebs/3modules/syncthing.nix162
-rw-r--r--krebs/3modules/tinc.nix7
-rw-r--r--krebs/3modules/tinc_graphs.nix2
-rw-r--r--krebs/3modules/tv/default.nix43
-rw-r--r--krebs/3modules/tv/wiregrill/alnus.pub1
-rw-r--r--krebs/3modules/tv/wiregrill/mu.pub1
-rw-r--r--krebs/3modules/tv/wiregrill/ni.pub1
-rw-r--r--krebs/3modules/tv/wiregrill/nomic.pub1
-rw-r--r--krebs/3modules/tv/wiregrill/querel.pub1
-rw-r--r--krebs/3modules/tv/wiregrill/wu.pub1
-rw-r--r--krebs/3modules/tv/wiregrill/xu.pub1
-rw-r--r--krebs/3modules/tv/wiregrill/zu.pub1
-rw-r--r--krebs/3modules/urlwatch.nix2
89 files changed, 2697 insertions, 1600 deletions
diff --git a/krebs/3modules/Reaktor.nix b/krebs/3modules/Reaktor.nix
index 99a7a55e..308c6d41 100644
--- a/krebs/3modules/Reaktor.nix
+++ b/krebs/3modules/Reaktor.nix
@@ -8,7 +8,7 @@ let
out = {
options.krebs.Reaktor = api;
- config = imp;
+ config = mkIf (cfg != {}) imp;
};
api = mkOption {
@@ -113,15 +113,17 @@ let
'';
in nameValuePair "Reaktor-${name}" {
path = with pkgs; [
- utillinux #flock for tell_on-join
git # for nag
+ jq # for tell
python # for caps
- ];
+ utillinux # flock for tell
+ ];
description = "Reaktor IRC Bot";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
environment = {
GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
+ PYTHONPATH = "${pkgs.Reaktor}/lib/python3.6/site-packages";
REAKTOR_NICKNAME = botcfg.nickname;
REAKTOR_DEBUG = (if botcfg.debug then "True" else "False");
REAKTOR_CHANNELS = lib.concatStringsSep "," botcfg.channels;
diff --git a/krebs/3modules/airdcpp.nix b/krebs/3modules/airdcpp.nix
new file mode 100644
index 00000000..56fb3179
--- /dev/null
+++ b/krebs/3modules/airdcpp.nix
@@ -0,0 +1,278 @@
+{ config, lib, pkgs, ... }:
+with import <stockholm/lib>; #genid
+let
+ cfg = config.krebs.airdcpp;
+
+ out = {
+ options.krebs.airdcpp = api;
+ config = lib.mkIf cfg.enable imp;
+ };
+
+ api = with types;{
+ enable = mkEnableOption "airdcpp";
+
+ package = mkOption {
+ type = package;
+ default = pkgs.airdcpp-webclient;
+ };
+
+ user = mkOption {
+ description = ''
+ user which will run airdcpp. if kept default a new user will be created
+ '';
+ type = str;
+ default = "airdcpp";
+ };
+ extraGroups = mkOption {
+ description = ''extra groups for the user (only for default user)'';
+ type = listOf str;
+ default = [];
+ example = [ "nginx" ];
+ };
+
+ stateDir = mkOption {
+ description = ''
+ directory for storing state (pid,config)
+ '';
+ type = str;
+ default = "/var/lib/airdcpp";
+ };
+ hubs = mkOption {
+ type = attrsOf (submodule ( { config, ... }: {
+ options = {
+ Nick = mkOption {
+ description = ''
+ Nick Name for hub
+ '';
+ type = str;
+ default = cfg.Nick;
+ };
+ Password = mkOption {
+ description = ''
+ Password to be used
+
+ WARNING: will be stored in plain text in /nix/store
+ '';
+ type = str;
+ default = "";
+ apply = lib.removeSuffix "\n";
+ };
+ Server = mkOption {
+ description = ''
+ URL to the hub (must be provided)
+ '';
+ type = str;
+ };
+ AutoConnect = mkOption {
+ description = ''
+ automatically connect to the hub
+ '';
+ type = bool;
+ default = false;
+ };
+ };
+ }));
+ description = "hubs which should be configured via Favorites.xml,
+ Options are only used if no initial Favorites.xml file is provided and none exists";
+ default = {};
+ };
+ initialFavoritesConfigFile = mkOption {
+ description = ''
+ path inital Favorites.xml configuration if none exists
+ '';
+ type = nullOr path;
+ default = null;
+ };
+ dcpp = {
+ # entries in DCPlusPlus.xml
+ Nick = mkOption {
+ description = ''
+ Nick Name for connection
+ '';
+ type = str;
+ default = "kevin";
+ };
+ InPort = mkOption {
+ description = "Input Port";
+ type = int;
+ default = 16849;
+ };
+ UDPPort = mkOption {
+ description = "UDP open Port";
+ type = int;
+ default = 16849;
+ };
+ TLSPort = mkOption {
+ description = "TLS open Port";
+ type = int;
+ default = 16869;
+ };
+ DownloadSpeed = mkOption {
+ description = "Total Download Speed in Mbps/s";
+ type = str;
+ default = "100";
+ };
+ UploadSpeed = mkOption {
+ description = "Total Upload Speed in Mbp/s";
+ type = str;
+ default = "100";
+ };
+ DownloadDirectory = mkOption {
+ description = "Directory, where new files will be saved into";
+ type = str;
+ default = "${cfg.stateDir}/Download";
+ };
+ shares = mkOption {
+ default = {};
+ type = attrsOf (submodule ( { config, ... }: {
+ options = {
+ path = mkOption {
+ description = "path to the share";
+ type = str;
+ };
+ incoming = mkOption {
+ description = "incoming";
+ type = bool;
+ default = false;
+ };
+ };
+ }));
+ };
+ initialConfigFile = mkOption {
+ description = ''
+ path inital DCPlusPlus.xml configuration if none exists
+ '';
+ type = nullOr path;
+ default = null;
+ };
+ };
+ web = {
+ port = mkOption {
+ description = ''web-ui port
+
+ NOTE: once the initial config had been written to the state directory it will not be replaced
+ '';
+ type = int;
+ default = 5600;
+ };
+ initialConfigFile = mkOption {
+ description = ''
+ path inital WebServer.xml configuration if none exists
+ '';
+ type = nullOr path;
+ default = null;
+ };
+ # TODO: tlsPort
+ users = mkOption {
+ type = attrsOf (submodule ( { config, ... }: {
+ options = {
+ password = mkOption {
+ description = "password of user";
+ type = str;
+ apply = lib.removeSuffix "\n";
+ };
+ permissions = mkOption {
+ description = "user permissions";
+ type = str;
+ default = "admin";
+ };
+ };
+ }));
+ };
+ };
+ };
+
+ imp = let
+ genUsers = users: concatMapStringsSep "\n" (user:
+ ''<WebUser Username="${user.name}" Password="${user.password}" LastLogin="0" Permissions="${user.permissions}"/>'' )
+ (mapAttrsToList (name: val: val // { inherit name; }) users);
+ webConfigFile = if (cfg.web.initialConfigFile == null) then builtins.trace "warning: airdcpp passwords are stored in plain text" pkgs.writeText "initial-config" ''
+ <?xml version="1.0" encoding="utf-8" standalone="yes"?>
+ <WebServer>
+ <Config>
+ <Server Port="${toString cfg.web.port}"/>
+ <TLSServer Port="0" Certificate="" CertificateKey=""/>
+ </Config>
+ <WebUsers>${genUsers cfg.web.users}
+ </WebUsers>
+ </WebServer>
+ '' else cfg.web.initialConfigFile;
+ genHubs = hubs: concatMapStringsSep "\n" (hub:
+ ''<Hub Name="${hub.name}" Connect="${
+ if hub.AutoConnect then "1" else "0"
+ }" Description="" Password="${hub.Password}" Server="${hub.Server}" ChatUserSplit="0" UserListState="1" HubFrameOrder="" HubFrameWidths="" HubFrameVisible="" Group="" Bottom="0" Top="0" Right="0" Left="0" Nick="${hub.Nick}"/>'' )
+ (mapAttrsToList (name: val: val // { inherit name; }) hubs);
+ favoritesConfigFile = if (cfg.initialFavoritesConfigFile == null) then
+ builtins.trace "warning: airdcpp hub passwords are stored in plain text" pkgs.writeText "initial-config" ''
+ <?xml version="1.0" encoding="utf-8" standalone="yes"?>
+ <Favorites>
+ <Hubs>
+ ${genHubs cfg.hubs}
+ </Hubs>
+ </Favorites>
+ '' else cfg.initialFavoritesConfigFile;
+ genShares = shares: concatMapStringsSep "\n" (share:
+ ''<Directory Virtual="${share.name}" Incoming="${
+ if share.incoming then "1" else "0"
+ }" LastRefreshTime="0">${share.path}</Directory>'' )
+ (mapAttrsToList (name: val: val // { inherit name; }) shares);
+ dcppConfigFile = if (cfg.dcpp.initialConfigFile == null) then pkgs.writeText "initial-config" ''
+ <?xml version="1.0" encoding="utf-8" standalone="yes"?>
+ <DCPlusPlus>
+ <Settings>
+ <Nick type="string">${cfg.dcpp.Nick}</Nick>
+ <InPort type="int">${toString cfg.dcpp.InPort}</InPort>
+ <UDPPort type="int">${toString cfg.dcpp.UDPPort}</UDPPort>
+ <TLSPort type="int">${toString cfg.dcpp.TLSPort}</TLSPort>
+ <DownloadDirectory type="string">${cfg.dcpp.DownloadDirectory}</DownloadDirectory>
+ <AutoDetectIncomingConnection type="int">0</AutoDetectIncomingConnection>
+ <NoIpOverride type="int">1</NoIpOverride>
+ <WizardRunNew type="int">0</WizardRunNew>
+ <IPUpdate type="int">0</IPUpdate>
+ <AlwaysCCPM type="int">1</AlwaysCCPM>
+ <DownloadSpeed type="string">${cfg.dcpp.DownloadSpeed}</DownloadSpeed>
+ <UploadSpeed type="string">${cfg.dcpp.UploadSpeed}</UploadSpeed>
+ </Settings>
+ <Share Token="0" Name="Default">
+ ${genShares cfg.dcpp.shares}
+ <NoShare/>
+ </Share>
+ <ChatFilterItems/>
+ </DCPlusPlus>
+ '' else cfg.dcpp.initialConfigFile;
+ in {
+ systemd.services.airdcpp = {
+ description = "airdcpp webui";
+ after = [ "network.target" "local-fs.target" ];
+ wantedBy = [ "multi-user.target" ];
+ restartIfChanged = true;
+ serviceConfig = {
+ Type = "simple";
+ ExecStartPre = pkgs.writeDash "prepare-env" ''
+ d=${cfg.stateDir}/WebServer.xml
+ test -e $d || install -m700 -o${cfg.user} ${webConfigFile} $d
+ d=${cfg.stateDir}/DCPlusPlus.xml
+ test -e $d || install -m700 -o${cfg.user} ${dcppConfigFile} $d
+ d=${cfg.stateDir}/Favorites.xml
+ test -e $d || install -m700 -o${cfg.user} ${favoritesConfigFile} $d
+ '';
+ PermissionsStartOnly = true;
+ ExecStart = "${cfg.package}/bin/airdcppd -c=${cfg.stateDir} -p=${cfg.stateDir}/airdcpp.pid";
+ PrivateTmp = true;
+ WorkingDirectory = cfg.stateDir;
+ User = "${cfg.user}";
+ };
+ };
+ users = lib.mkIf (cfg.user == "airdcpp") {
+ users.airdcpp = {
+ uid = genid "airdcpp";
+ home = cfg.stateDir;
+ createHome = true;
+ inherit (cfg) extraGroups;
+ };
+ groups.airdcpp.gid = genid "airdcpp";
+ };
+ };
+in
+out
+
diff --git a/krebs/3modules/announce-activation.nix b/krebs/3modules/announce-activation.nix
index 8f8440eb..76eb4b13 100644
--- a/krebs/3modules/announce-activation.nix
+++ b/krebs/3modules/announce-activation.nix
@@ -53,7 +53,7 @@ in {
};
};
config = mkIf cfg.enable {
- system.activationScripts.announce-activation = ''
+ system.activationScripts.announce-activation = stringAfter [ "etc" ] ''
${announce-activation}
'';
};
diff --git a/krebs/3modules/bepasty-server.nix b/krebs/3modules/bepasty-server.nix
index dd29a4e1..94a50952 100644
--- a/krebs/3modules/bepasty-server.nix
+++ b/krebs/3modules/bepasty-server.nix
@@ -2,10 +2,10 @@
with import <stockholm/lib>;
let
- gunicorn = pkgs.pythonPackages.gunicorn;
- bepasty = pkgs.bepasty;
- gevent = pkgs.pythonPackages.gevent;
- python = pkgs.pythonPackages.python;
+ gunicorn = pkgs.python27Packages.gunicorn;
+ bepasty = pkgs.bepasty.override { python3Packages = pkgs.python27Packages; };
+ gevent = pkgs.python27Packages.gevent;
+ python = pkgs.python27Packages.python;
cfg = config.krebs.bepasty;
out = {
@@ -143,12 +143,12 @@ let
) cfg.servers;<