summaryrefslogtreecommitdiffstats
path: root/lass
diff options
context:
space:
mode:
Diffstat (limited to 'lass')
-rw-r--r--lass/2configs/baseX.nix1
-rw-r--r--lass/2configs/mail.nix4
-rw-r--r--lass/2configs/monitoring/client.nix106
-rw-r--r--lass/2configs/monitoring/server.nix37
-rw-r--r--lass/2configs/nixpkgs.nix2
-rw-r--r--lass/2configs/websites/domsen.nix10
-rw-r--r--lass/3modules/default.nix1
-rw-r--r--lass/3modules/urxvtd.nix55
-rw-r--r--lass/5pkgs/xmonad-lass.nix1
9 files changed, 48 insertions, 169 deletions
diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix
index e879e8e58..2933ca0e4 100644
--- a/lass/2configs/baseX.nix
+++ b/lass/2configs/baseX.nix
@@ -66,7 +66,6 @@ in {
youtube-tools
rxvt_unicode
- termite
#window manager stuff
#haskellPackages.xmobar
#haskellPackages.yeganesh
diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix
index 872acc003..5ca84133d 100644
--- a/lass/2configs/mail.nix
+++ b/lass/2configs/mail.nix
@@ -17,7 +17,7 @@ let
muttrc = pkgs.writeText "muttrc" ''
# gpg
- source ${pkgs.mutt-kz}/share/doc/mutt-kz/samples/gpg.rc
+ source ${pkgs.neomutt}/share/doc/neomutt/samples/gpg.rc
set pgp_use_gpg_agent = yes
set pgp_sign_as = 0x976A7E4D
set crypt_autosign = yes
@@ -99,7 +99,7 @@ let
'';
mutt = pkgs.writeDashBin "mutt" ''
- exec ${pkgs.mutt-kz}/bin/mutt -F ${muttrc} $@
+ exec ${pkgs.neomutt}/bin/mutt -F ${muttrc} $@
'';
in {
diff --git a/lass/2configs/monitoring/client.nix b/lass/2configs/monitoring/client.nix
index e879d6960..b8c245215 100644
--- a/lass/2configs/monitoring/client.nix
+++ b/lass/2configs/monitoring/client.nix
@@ -1,94 +1,26 @@
{pkgs, config, ...}:
with import <stockholm/lib>;
{
- lass.telegraf = {
+ services.telegraf = {
enable = true;
- interval = "1s";
-
- outputs = ''
- [outputs.influxdb]
- urls = ["http://prism:8086"]
- database = "telegraf_db"
- user_agent = "telegraf"
- '';
- inputs = [
- ''
- [cpu]
- percpu = false
- totalcpu = true
- drop = ["cpu_time"]
- ''
- ''
- [[inputs.mem]]
- ''
- ''
- [[inputs.ping]]
- urls = ["8.8.8.8"]
- ''
- ''
- [[inputs.net]]
- ''
- ''
- [[inputs.dns_query]]
- servers = ["8.8.8.8"]
- ''
- ];
- };
- systemd.services.telegraf.path = with pkgs; [
- iputils
- lm_sensors
- ];
-
- services.collectd = {
- enable = true;
- autoLoadPlugin = true;
- extraConfig = ''
- Hostname ${config.krebs.build.host.name}
- LoadPlugin load
- LoadPlugin disk
- LoadPlugin memory
- Interval 30.0
-
- LoadPlugin interface
- <Plugin "interface">
- Interface "*Link"
- Interface "lo"
- Interface "vboxnet*"
- Interface "virbr*"
- IgnoreSelected true
- </Plugin>
-
- LoadPlugin df
- <Plugin "df">
- MountPoint "/nix/store"
- FSType "tmpfs"
- FSType "binfmt_misc"
- FSType "debugfs"
- FSType "mqueue"
- FSType "hugetlbfs"
- FSType "systemd-1"
- FSType "cgroup"
- FSType "securityfs"
- FSType "ramfs"
- FSType "proc"
- FSType "devpts"
- FSType "devtmpfs"
- MountPoint "/var/lib/docker/devicemapper"
- IgnoreSelected true
- </Plugin>
-
- LoadPlugin cpu
- <Plugin cpu>
- ReportByCpu true
- ReportByState true
- ValuesPercentage true
- </Plugin>
-
- LoadPlugin network
- <Plugin "network">
- Server "prism" "25826"
- </Plugin>
- '';
+ extraConfig = {
+ agent.interval = "1s";
+ outputs = {
+ influxdb = {
+ urls = ["http://prism:8086"];
+ database = "telegraf_db";
+ user_agent = "telegraf";
+ };
+ };
+ inputs = {
+ cpu = {
+ percpu = false;
+ totalcpu = true;
+ };
+ mem = {};
+ net = {};
+ };
+ };
};
}
diff --git a/lass/2configs/monitoring/server.nix b/lass/2configs/monitoring/server.nix
index 2e1c15ca1..505cb7a17 100644
--- a/lass/2configs/monitoring/server.nix
+++ b/lass/2configs/monitoring/server.nix
@@ -1,9 +1,7 @@
{pkgs, config, ...}:
with import <stockholm/lib>;
{
- services.influxdb = {
- enable = true;
- };
+ services.influxdb.enable = true;
services.influxdb.extraConfig = {
meta.hostname = config.krebs.build.host.name;
@@ -29,24 +27,39 @@ with import <stockholm/lib>;
data="$(${pkgs.jq}/bin/jq -r .message)"
export LOGNAME=prism-alarm
${pkgs.irc-announce}/bin/irc-announce \
- irc.freenode.org 6667 prism-alarm \#krebs-bots "$data" >/dev/null
+ ni.r 6667 prism-alarm \#retiolum "$data" >/dev/null
'';
in {
enable = true;
+ check_db = "telegraf_db";
alarms = {
- test2 = ''
- batch
+ cpu = ''
+ var data = batch
|query(${"'''"}
SELECT mean("usage_user") AS mean
FROM "${config.lass.kapacitor.check_db}"."default"."cpu"
${"'''"})
- .every(3m)
- .period(1m)
+ .period(10m)
+ .every(1m)
+ .groupBy('host')
+ data |alert()
+ .crit(lambda: "mean" > 90)
+ .exec('${echoToIrc}')
+ data |deadman(1.0,5m)
+ .stateChangesOnly()
+ .exec('${echoToIrc}')
+ '';
+ ram = ''
+ var data = batch
+ |query(${"'''"}
+ SELECT mean("used_percent") AS mean
+ FROM "${config.lass.kapacitor.check_db}"."default"."mem"
+ ${"'''"})
+ .period(10m)
+ .every(1m)
.groupBy('host')
- |alert()
- .crit(lambda: "mean" > 90)
- // Whenever we get an alert write it to a file.
- .log('/tmp/alerts.log')
+ data |alert()
+ .crit(lambda: "mean" > 90)
.exec('${echoToIrc}')
'';
};
diff --git a/lass/2configs/nixpkgs.nix b/lass/2configs/nixpkgs.nix
index 4a1b0379b..e7229654d 100644
--- a/lass/2configs/nixpkgs.nix
+++ b/lass/2configs/nixpkgs.nix
@@ -3,6 +3,6 @@
{
krebs.build.source.nixpkgs.git = {
url = https://github.com/nixos/nixpkgs;
- ref = "5fff5a902594b34471b613eb2babcec923e1e1f1";
+ ref = "f66d782";
};
}
diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix
index 66fc681b1..0b75425c4 100644
--- a/lass/2configs/websites/domsen.nix
+++ b/lass/2configs/websites/domsen.nix
@@ -118,8 +118,7 @@ in {
{ from = "mail@jla-trading.com"; to = "jla-trading"; }
{ from = "jms@ubikmedia.eu"; to = "jms"; }
{ from = "ms@ubikmedia.eu"; to = "ms"; }
- { from = "nrg@ubikmedia.eu"; to = "nrg"; }
- { from = "ubik@ubikmedia.eu"; to = "domsen, jms, ms, nrg"; }
+ { from = "ubik@ubikmedia.eu"; to = "domsen, jms, ms"; }
{ from = "testuser@lassul.us"; to = "testuser"; }
];
@@ -161,13 +160,6 @@ in {
createHome = true;
};
- users.users.nrg = {
- uid = genid_signed "nrg";
- home = "/home/nrg";
- useDefaultShell = true;
- createHome = true;
- };
-
users.users.testuser = {
uid = genid_signed "testuser";
home = "/home/testuser";
diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix
index 2bf2df8b3..f97b041ac 100644
--- a/lass/3modules/default.nix
+++ b/lass/3modules/default.nix
@@ -6,7 +6,6 @@ _:
./hosts.nix
./mysql-backup.nix
./umts.nix
- ./urxvtd.nix
./usershadow.nix
./xresources.nix
./kapacitor.nix
diff --git a/lass/3modules/urxvtd.nix b/lass/3modules/urxvtd.nix
deleted file mode 100644
index 469616a9f..000000000
--- a/lass/3modules/urxvtd.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-let
-in
-
-with builtins;
-with lib;
-
-{
- options = {
- services.urxvtd = {
- enable = mkOption {
- type = types.bool;
- default = false;
- description = "Enable urxvtd per user";
- };
- users = mkOption {
- type = types.listOf types.string;
- default = [];
- description = "users to run urxvtd for";
- };
- urxvtPackage = mkOption {
- type = types.package;
- default = pkgs.rxvt_unicode;
- description = "urxvt package to use";
- };
- };
- };
-
- config =
- let
- cfg = config.services.urxvtd;
- users = cfg.users;
- urxvt = cfg.urxvtPackage;
- mkService = user: {
- description = "urxvt terminal daemon";
- wantedBy = [ "multi-user.target" ];
- restartIfChanged = false;
- path = [ pkgs.xlibs.xrdb ];
- environment = {
- DISPLAY = ":0";
- URXVT_PERL_LIB = "${urxvt}/lib/urxvt/perl";
- };
- serviceConfig = {
- Restart = "always";
- User = user;
- ExecStart = "${urxvt}/bin/urxvtd";
- };
- };
- in
- mkIf cfg.enable {
- environment.systemPackages = [ urxvt ];
- systemd.services = listToAttrs (map (u: { name = "${u}-urxvtd"; value = mkService u; }) users);
- };
-}
diff --git a/lass/5pkgs/xmonad-lass.nix b/lass/5pkgs/xmonad-lass.nix
index cf8eaf058..dd4d8803c 100644
--- a/lass/5pkgs/xmonad-lass.nix
+++ b/lass/5pkgs/xmonad-lass.nix
@@ -129,7 +129,6 @@ myKeyMap =
, ("M4-<Esc>", toggleWS)
, ("M4-S-<Enter>", spawn urxvtcPath)
, ("M4-x", floatNext True >> spawn urxvtcPath)
- , ("M4-z", floatNext True >> spawn "${pkgs.termite}/bin/termite")
, ("M4-f", floatNext True)
, ("M4-b", sendMessage ToggleStruts)