From 0f34276090f804b7eed2bf45a0804a69fbe8ae35 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 26 Dec 2016 13:50:42 +0100 Subject: l 1 prism: import libvirt --- lass/1systems/prism.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lass/1systems') diff --git a/lass/1systems/prism.nix b/lass/1systems/prism.nix index 6c11a2f62..7646f7163 100644 --- a/lass/1systems/prism.nix +++ b/lass/1systems/prism.nix @@ -24,6 +24,7 @@ in { ../2configs/repo-sync.nix ../2configs/binary-cache/server.nix ../2configs/iodined.nix + ../2configs/libvirt.nix { users.extraGroups = { # ● systemd-tmpfiles-setup.service - Create Volatile Files and Directories @@ -228,10 +229,6 @@ in { enable = true; }; } - { - virtualisation.libvirtd.enable = true; - users.users.mainUser.extraGroups = [ "libvirtd" ]; - } ]; krebs.build.host = config.krebs.hosts.prism; -- cgit v1.2.3 From b9e3b93105d4214de43ee596adff7cf661311780 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 26 Dec 2016 14:18:08 +0100 Subject: l: krebs.nginx -> services.nginx --- lass/1systems/mors.nix | 14 ++++++-------- lass/1systems/prism.nix | 23 +++++++++-------------- 2 files changed, 15 insertions(+), 22 deletions(-) (limited to 'lass/1systems') diff --git a/lass/1systems/mors.nix b/lass/1systems/mors.nix index 4553cc15b..dcdb57f3b 100644 --- a/lass/1systems/mors.nix +++ b/lass/1systems/mors.nix @@ -66,20 +66,18 @@ with import ; }; } { - krebs.nginx = { + services.nginx = { enable = true; - servers.default = { - server-names = [ + virtualHosts.default = { + serverAliases = [ "localhost" "${config.krebs.build.host.name}" "${config.krebs.build.host.name}.r" "${config.krebs.build.host.name}.retiolum" ]; - locations = [ - (nameValuePair "~ ^/~(.+?)(/.*)?\$" '' - alias /home/$1/public_html$2; - '') - ]; + locations."~ ^/~(.+?)(/.*)?\$".extraConfig = '' + alias /home/$1/public_html$2; + ''; }; }; } diff --git a/lass/1systems/prism.nix b/lass/1systems/prism.nix index 7646f7163..efe79052f 100644 --- a/lass/1systems/prism.nix +++ b/lass/1systems/prism.nix @@ -179,11 +179,9 @@ in { imports = [ ../2configs/realwallpaper.nix ]; - krebs.nginx.servers."lassul.us".locations = [ - (lib.nameValuePair "/wallpaper.png" '' - alias /tmp/wallpaper.png; - '') - ]; + services.nginx.virtualHosts."lassul.us".locations."/wallpaper.png".extraConfig = '' + alias /tmp/wallpaper.png; + ''; } { environment.systemPackages = with pkgs; [ @@ -203,16 +201,13 @@ in { }; } { - krebs.nginx = { + services.nginx = { enable = true; - servers.public = { - listen = [ "8088" ]; - server-names = [ "default" ]; - locations = [ - (nameValuePair "~ ^/~(.+?)(/.*)?\$" '' - alias /home/$1/public_html$2; - '') - ]; + virtualHosts.public = { + port = 8088; + locations."~ ^/~(.+?)(/.*)?\$".extraConfig = '' + alias /home/$1/public_html$2; + ''; }; }; krebs.iptables.tables.filter.INPUT.rules = [ -- cgit v1.2.3 From adfb714638748f397fc05da46e07f47c9ab90a00 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 26 Dec 2016 14:23:52 +0100 Subject: l 2: add hfos.nix --- lass/1systems/prism.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/1systems') diff --git a/lass/1systems/prism.nix b/lass/1systems/prism.nix index efe79052f..39026d102 100644 --- a/lass/1systems/prism.nix +++ b/lass/1systems/prism.nix @@ -25,6 +25,7 @@ in { ../2configs/binary-cache/server.nix ../2configs/iodined.nix ../2configs/libvirt.nix + ../2configs/hfos.nix { users.extraGroups = { # ● systemd-tmpfiles-setup.service - Create Volatile Files and Directories -- cgit v1.2.3 From 2090e075e2ca34c3df02144123bd7e89fe8f6533 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 26 Dec 2016 18:52:29 +0100 Subject: l 1 mors: disable skype --- lass/1systems/mors.nix | 1 - 1 file changed, 1 deletion(-) (limited to 'lass/1systems') diff --git a/lass/1systems/mors.nix b/lass/1systems/mors.nix index dcdb57f3b..ecf437b80 100644 --- a/lass/1systems/mors.nix +++ b/lass/1systems/mors.nix @@ -17,7 +17,6 @@ with import ; ../2configs/steam.nix ../2configs/wine.nix ../2configs/git.nix - ../2configs/skype.nix ../2configs/libvirt.nix ../2configs/fetchWallpaper.nix #../2configs/c-base.nix -- cgit v1.2.3 From 65ae1909259f30150d30ae0618461b7245e33120 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Dec 2016 01:20:44 +0100 Subject: l 1 mors: disable obsolete mongoDB --- lass/1systems/mors.nix | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lass/1systems') diff --git a/lass/1systems/mors.nix b/lass/1systems/mors.nix index ecf437b80..ddb269e9d 100644 --- a/lass/1systems/mors.nix +++ b/lass/1systems/mors.nix @@ -235,8 +235,4 @@ with import ; krebs.repo-sync.timerConfig = { OnCalendar = "00:37"; }; - - services.mongodb = { - enable = true; - }; } -- cgit v1.2.3 From 8777507336421ae45bcf3b7fdbdb5b1ab9bcabd2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Dec 2016 22:59:22 +0100 Subject: l 1 mors: add graphite_beacon testing code --- lass/1systems/mors.nix | 131 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) (limited to 'lass/1systems') diff --git a/lass/1systems/mors.nix b/lass/1systems/mors.nix index ddb269e9d..3498f662b 100644 --- a/lass/1systems/mors.nix +++ b/lass/1systems/mors.nix @@ -86,6 +86,137 @@ with import ; { virtualisation.libvirtd.enable = true; } + { + services.nginx = { + enable = mkDefault true; + virtualHosts = { + "stats.mors" = { + locations = { + "/" = { + proxyPass = "http://localhost:3000/"; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + ''; + }; + }; + }; + }; + }; + + services.grafana = { + enable = true; + addr = "127.0.0.1"; + users.allowSignUp = false; + users.allowOrgCreate = false; + users.autoAssignOrg = false; + auth.anonymous.enable = true; + security = import ; # { AdminUser = ""; adminPassword = ""} + }; + + services.graphite = { + api = { + enable = true; + listenAddress = "127.0.0.1"; + port = 18080; + }; + carbon = { + enableCache = true; + # save disk usage by restricting to 1 bulk update per second + config = '' + [cache] + MAX_CACHE_SIZE = inf + MAX_UPDATES_PER_SECOND = 1 + MAX_CREATES_PER_MINUTE = 500 + ''; + storageSchemas = '' + [carbon] + pattern = ^carbon\. + retentions = 60:90d + + [elchos] + patterhn = ^elchos\. + retentions = 10s:30d,60s:3y + + [default] + pattern = .* + retentions = 30s:30d,300s:1y + ''; + }; + }; + + services.collectd = { + enable = true; + include = [ (toString (pkgs.writeText "collectd-graphite-cfg" '' + LoadPlugin write_graphite + + + Host "localhost" + Port "2003" + EscapeCharacter "_" + StoreRates false + AlwaysAppendDS false + + + '')) + ]; + extraConfig = '' + LoadPlugin interface + LoadPlugin battery + LoadPlugin load + LoadPlugin cpu + LoadPlugin entropy + LoadPlugin write_graphite + + Interface "et0" + Interface "wl0" + Interface "retiolum" + + ''; + }; + services.graphite.beacon = { + enable = true; + config = { + graphite_url = "http://localhost:18080"; + cli = { + command = ''${pkgs.irc-announce}/bin/irc-announce irc.freenode.org 6667 mors-beacon-alert \#krebs ' ''${level} ''${name} ''${value}' ''; + }; + smtp = { + from = "beacon@mors.r"; + to = [ + "lass@mors.r" + ]; + }; + normal_handlers = [ + "smtp" + "cli" + ]; + warning_handlers = [ + "smtp" + "cli" + ]; + critical_handlers = [ + "smtp" + "cli" + ]; + alerts = [ + { + name = "testbattery"; + query = "*.battery-0.capacity"; + method = "last_value"; + interval = "1minute"; + logging = "info"; + repeat_interval = "5minute"; + rules = [ + "warning: < 30.0" + "critical: < 10.0" + ]; + } + ]; + }; + }; + } ]; krebs.build.host = config.krebs.hosts.mors; -- cgit v1.2.3