summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--krebs/4lib/infest/finalize.sh2
-rw-r--r--krebs/4lib/infest/prepare.sh7
-rw-r--r--lass/2configs/desktop-base.nix1
-rw-r--r--lass/2configs/os-templates/CAC-CentOS-6.5-64bit.nix47
-rw-r--r--lass/3modules/newsbot-js.nix87
-rw-r--r--lass/5pkgs/newsbot-js/default.nix4
-rw-r--r--makefu/3modules/tinc_graphs.nix6
-rw-r--r--makefu/5pkgs/tinc_graphs/default.nix5
8 files changed, 152 insertions, 7 deletions
diff --git a/krebs/4lib/infest/finalize.sh b/krebs/4lib/infest/finalize.sh
index 0039960c..94b13e0b 100644
--- a/krebs/4lib/infest/finalize.sh
+++ b/krebs/4lib/infest/finalize.sh
@@ -3,8 +3,8 @@ set -eux
{
umount /mnt/nix
umount /mnt/root
- umount /boot || :
umount /mnt/boot
+ umount /boot || :
umount /mnt
coreutils_path=$(set +f; for i in /nix/store/*coreutils*/bin; do :; done; echo $i)
diff --git a/krebs/4lib/infest/prepare.sh b/krebs/4lib/infest/prepare.sh
index 9fbd5be8..94c9b0fb 100644
--- a/krebs/4lib/infest/prepare.sh
+++ b/krebs/4lib/infest/prepare.sh
@@ -18,6 +18,13 @@ prepare() {(
esac
;;
esac
+ elif test -e /etc/centos-release; then
+ case $(cat /etc/centos-release) in
+ 'CentOS release 6.5 (Final)')
+ prepare_centos "$@"
+ exit
+ ;;
+ esac
fi
echo "$0 prepare: unknown OS" >&2
exit -1
diff --git a/lass/2configs/desktop-base.nix b/lass/2configs/desktop-base.nix
index 4e693997..27aadb59 100644
--- a/lass/2configs/desktop-base.nix
+++ b/lass/2configs/desktop-base.nix
@@ -30,6 +30,7 @@ in {
powertop
sxiv
much
+ push
#window manager stuff
haskellPackages.xmobar
diff --git a/lass/2configs/os-templates/CAC-CentOS-6.5-64bit.nix b/lass/2configs/os-templates/CAC-CentOS-6.5-64bit.nix
new file mode 100644
index 00000000..b5ec722a
--- /dev/null
+++ b/lass/2configs/os-templates/CAC-CentOS-6.5-64bit.nix
@@ -0,0 +1,47 @@
+_:
+
+{
+ boot.loader.grub = {
+ device = "/dev/sda";
+ splashImage = null;
+ };
+
+ boot.initrd.availableKernelModules = [
+ "ata_piix"
+ "vmw_pvscsi"
+ ];
+
+ fileSystems."/" = {
+ device = "/dev/VolGroup/lv_root";
+ fsType = "ext4";
+ };
+
+ fileSystems."/boot" = {
+ device = "/dev/sda1";
+ fsType = "ext4";
+ };
+
+ swapDevices = [
+ { device = "/dev/VolGroup/lv_swap"; }
+ ];
+
+ users.extraGroups = {
+ # ● systemd-tmpfiles-setup.service - Create Volatile Files and Directories
+ # Loaded: loaded (/nix/store/2l33gg7nmncqkpysq9f5fxyhlw6ncm2j-systemd-217/example/systemd/system/systemd-tmpfiles-setup.service)
+ # Active: failed (Result: exit-code) since Mon 2015-03-16 10:29:18 UTC; 4s ago
+ # Docs: man:tmpfiles.d(5)
+ # man:systemd-tmpfiles(8)
+ # Process: 19272 ExecStart=/nix/store/2l33gg7nmncqkpysq9f5fxyhlw6ncm2j-systemd-217/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev (code=exited, status=1/FAILURE)
+ # Main PID: 19272 (code=exited, status=1/FAILURE)
+ #
+ # Mar 16 10:29:17 cd systemd-tmpfiles[19272]: [/usr/lib/tmpfiles.d/legacy.conf:26] Unknown group 'lock'.
+ # Mar 16 10:29:18 cd systemd-tmpfiles[19272]: Two or more conflicting lines for /var/log/journal configured, ignoring.
+ # Mar 16 10:29:18 cd systemd-tmpfiles[19272]: Two or more conflicting lines for /var/log/journal/7b35116927d74ea58785e00b47ac0f0d configured, ignoring.
+ # Mar 16 10:29:18 cd systemd[1]: systemd-tmpfiles-setup.service: main process exited, code=exited, status=1/FAILURE
+ # Mar 16 10:29:18 cd systemd[1]: Failed to start Create Volatile Files and Directories.
+ # Mar 16 10:29:18 cd systemd[1]: Unit systemd-tmpfiles-setup.service entered failed state.
+ # Mar 16 10:29:18 cd systemd[1]: systemd-tmpfiles-setup.service failed.
+ # warning: error(s) occured while switching to the new configuration
+ lock.gid = 10001;
+ };
+}
diff --git a/lass/3modules/newsbot-js.nix b/lass/3modules/newsbot-js.nix
new file mode 100644
index 00000000..6d87d256
--- /dev/null
+++ b/lass/3modules/newsbot-js.nix
@@ -0,0 +1,87 @@
+{ config, lib, pkgs, ... }:
+
+with builtins;
+with lib;
+
+let
+ cfg = config.lass.newsbot-js;
+
+ out = {
+ options.lass.newsbot-js = api;
+ config = mkIf cfg.enable imp;
+ };
+
+ api = {
+ enable = mkEnableOption "Enable krebs newsbot";
+ ircServer = mkOption {
+ type = types.str;
+ default = "echelon.retiolum";
+ description = "to which server the bot should connect";
+ };
+ channel = mkOption {
+ type = types.str;
+ default = "#news";
+ description = "post the news in this channel";
+ };
+ masterNick = mkOption {
+ type = types.str;
+ default = "knews";
+ description = "nickname of the master bot";
+ };
+ feeds = mkOption {
+ type = types.path;
+ description = ''
+ file with feeds to post
+ format:
+ $nick|$feedURI
+ '';
+ };
+ urlShortenerHost = mkOption {
+ type = types.str;
+ default = "echelon";
+ description = "what server to use for url shortening, host";
+ };
+ urlShortenerPort = mkOption {
+ type = types.str;
+ default = "80";
+ description = "what server to use for url shortening, port";
+ };
+ };
+
+ imp = {
+ users.extraUsers.newsbot-js = {
+ name = "newsbot-js";
+ uid = 1616759810; #genid newsbot-js
+ description = "newsbot-js user";
+ home = "/var/empty";
+ };
+
+ systemd.services.newsbot-js = {
+ description = "krebs newsbot";
+ after = [ "network.target" ];
+ wantedBy = [ "multi-user.target" ];
+
+ path = with pkgs; [
+ newsbot-js
+ ];
+
+ environment = {
+ irc_server = cfg.ircServer;
+ master_nick = cfg.masterNick;
+ news_channel = cfg.channel;
+ feeds_file = cfg.feeds;
+ url_shortener_host = cfg.urlShortenerHost;
+ url_shortener_port = cfg.urlShortenerPort;
+ };
+
+ restartIfChanged = true;
+
+ serviceConfig = {
+ User = "newsbot-js";
+ Restart = "always";
+ ExecStart = "${pkgs.newsbot-js}/bin/newsbot";
+ };
+ };
+ };
+
+in out
diff --git a/lass/5pkgs/newsbot-js/default.nix b/lass/5pkgs/newsbot-js/default.nix
index 7758b04d..ace2a976 100644
--- a/lass/5pkgs/newsbot-js/default.nix
+++ b/lass/5pkgs/newsbot-js/default.nix
@@ -26,8 +26,8 @@ in nodePackages.buildNodePackage {
src = fetchgit {
url = "http://cgit.echelon/newsbot-js/";
- rev = "cd32ef7b39819f53c7125b22c594202724cc8754";
- sha256 = "425e800f7638a5679ed8a049614a7533f3c8dd09659061885240dc93952ff0ae";
+ rev = "b22729670236bfa6491207d57c5d7565137625ca";
+ sha256 = "8ff00de56d85543399776c82d41d92ccc68000e5dce0f008d926748e188f3c69";
};
phases = [
diff --git a/makefu/3modules/tinc_graphs.nix b/makefu/3modules/tinc_graphs.nix
index 62d60752..ff2f5587 100644
--- a/makefu/3modules/tinc_graphs.nix
+++ b/makefu/3modules/tinc_graphs.nix
@@ -83,7 +83,9 @@ let
ExecStartPre = pkgs.writeScript "tinc_graphs-init" ''
#!/bin/sh
- mkdir -p "${external_dir}" "${internal_dir}"
+ if ! test -e "${cfg.workingDir}/internal/index.html"; then
+ cp -fr "$(${pkgs.tinc_graphs}/bin/tincstats-static-dir)/internal/" "${internal_dir}"
+ fi
'';
ExecStart = "${pkgs.tinc_graphs}/bin/all-the-graphs";
@@ -94,10 +96,10 @@ let
# this is needed because homedir is created with 700
chmod 755 "${cfg.workingDir}"
'';
+ PrivateTmp = "yes";
User = "root"; # tinc cannot be queried as user,
# seems to be a tinc-pre issue
- privateTmp = true;
};
};
diff --git a/makefu/5pkgs/tinc_graphs/default.nix b/makefu/5pkgs/tinc_graphs/default.nix
index 5bc97415..62a787d3 100644
--- a/makefu/5pkgs/tinc_graphs/default.nix
+++ b/makefu/5pkgs/tinc_graphs/default.nix
@@ -2,20 +2,21 @@
python3Packages.buildPythonPackage rec {
name = "tinc_graphs-${version}";
- version = "0.2.12";
+ version = "0.3.6";
propagatedBuildInputs = with pkgs;[
python3Packages.pygeoip
## ${geolite-legacy}/share/GeoIP/GeoIPCity.dat
];
src = fetchurl {
url = "https://pypi.python.org/packages/source/t/tinc_graphs/tinc_graphs-${version}.tar.gz";
- sha256 = "03jxvxahpcbpnz4668x32b629dwaaz5jcjkyaijm0zzpgcn4cbgp";
+ sha256 = "0ghdx9aaipmppvc2b6cgks4nxw6zsb0fhjrmnisbx7rz0vjvzc74";
};
preFixup = with pkgs;''
wrapProgram $out/bin/build-graphs --prefix PATH : "$out/bin"
wrapProgram $out/bin/all-the-graphs --prefix PATH : "${imagemagick}/bin:${graphviz}/bin:$out/bin"
wrapProgram $out/bin/tinc-stats2json --prefix PATH : "${tinc}/bin"
'';
+
meta = {
homepage = http://krebsco.de/;
description = "Create Graphs from Tinc Stats";