diff options
| -rw-r--r-- | _sources/generated.json | 43 | ||||
| -rw-r--r-- | _sources/generated.nix | 28 | ||||
| -rw-r--r-- | hosts/vidhar/prometheus/default.nix | 8 | ||||
| -rw-r--r-- | modules/prometheus-lvm-exporter.nix | 57 | ||||
| -rw-r--r-- | nvfetcher.toml | 11 | ||||
| -rw-r--r-- | overlays/etesync-dav.nix | 61 | ||||
| -rw-r--r-- | overlays/prometheus-lvm-exporter.nix | 18 |
7 files changed, 217 insertions, 9 deletions
diff --git a/_sources/generated.json b/_sources/generated.json index d7a62e6b..d3b81268 100644 --- a/_sources/generated.json +++ b/_sources/generated.json | |||
| @@ -39,6 +39,26 @@ | |||
| 39 | }, | 39 | }, |
| 40 | "version": "0077334cc299aa7885f804d88f52cdb1b35caf71" | 40 | "version": "0077334cc299aa7885f804d88f52cdb1b35caf71" |
| 41 | }, | 41 | }, |
| 42 | "etebase-py": { | ||
| 43 | "cargoLocks": null, | ||
| 44 | "date": "2022-07-06", | ||
| 45 | "extract": null, | ||
| 46 | "name": "etebase-py", | ||
| 47 | "passthru": null, | ||
| 48 | "pinned": false, | ||
| 49 | "src": { | ||
| 50 | "deepClone": false, | ||
| 51 | "fetchSubmodules": false, | ||
| 52 | "leaveDotGit": false, | ||
| 53 | "name": null, | ||
| 54 | "owner": "etesync", | ||
| 55 | "repo": "etebase-py", | ||
| 56 | "rev": "ac3e5138a2e18dc11f77d9a75f07d4b8dd8c4445", | ||
| 57 | "sha256": "sha256-OSzOoL7o4rWYOK1OyxfpslOnNfnK5CKhdhiFEXz/WvY=", | ||
| 58 | "type": "github" | ||
| 59 | }, | ||
| 60 | "version": "ac3e5138a2e18dc11f77d9a75f07d4b8dd8c4445" | ||
| 61 | }, | ||
| 42 | "lesspipe": { | 62 | "lesspipe": { |
| 43 | "cargoLocks": null, | 63 | "cargoLocks": null, |
| 44 | "date": null, | 64 | "date": null, |
| @@ -202,6 +222,21 @@ | |||
| 202 | }, | 222 | }, |
| 203 | "version": "2.03" | 223 | "version": "2.03" |
| 204 | }, | 224 | }, |
| 225 | "prometheus-lvm-exporter": { | ||
| 226 | "cargoLocks": null, | ||
| 227 | "date": null, | ||
| 228 | "extract": null, | ||
| 229 | "name": "prometheus-lvm-exporter", | ||
| 230 | "passthru": null, | ||
| 231 | "pinned": false, | ||
| 232 | "src": { | ||
| 233 | "name": null, | ||
| 234 | "sha256": "sha256-bytPqK2kvDrskbvmyybejUr1+RU6YdOgzmtqbKyfSNA=", | ||
| 235 | "type": "url", | ||
| 236 | "url": "https://github.com/hansmi/prometheus-lvm-exporter/archive/refs/tags/v0.3.1.tar.gz" | ||
| 237 | }, | ||
| 238 | "version": "0.3.1" | ||
| 239 | }, | ||
| 205 | "psql-versioning": { | 240 | "psql-versioning": { |
| 206 | "cargoLocks": null, | 241 | "cargoLocks": null, |
| 207 | "date": "2020-02-18", | 242 | "date": "2020-02-18", |
| @@ -253,7 +288,7 @@ | |||
| 253 | }, | 288 | }, |
| 254 | "v4l2loopback": { | 289 | "v4l2loopback": { |
| 255 | "cargoLocks": null, | 290 | "cargoLocks": null, |
| 256 | "date": "2022-08-05", | 291 | "date": "2022-11-09", |
| 257 | "extract": null, | 292 | "extract": null, |
| 258 | "name": "v4l2loopback", | 293 | "name": "v4l2loopback", |
| 259 | "passthru": null, | 294 | "passthru": null, |
| @@ -265,11 +300,11 @@ | |||
| 265 | "name": null, | 300 | "name": null, |
| 266 | "owner": "umlaeute", | 301 | "owner": "umlaeute", |
| 267 | "repo": "v4l2loopback", | 302 | "repo": "v4l2loopback", |
| 268 | "rev": "76434ab6f71d5ecbff8a218ff6bed91ea2bf73b8", | 303 | "rev": "8902b3f11413166e7823c377dbf876bae1fab137", |
| 269 | "sha256": "sha256-c6g63jW+a+v/TxLD9NnQGn/aUgivwVkxzP+hZ65w2/o=", | 304 | "sha256": "sha256-p/tGXO2+EogR4BdZ+KxonyBnYHznJrqKM6cRg1G37xA=", |
| 270 | "type": "github" | 305 | "type": "github" |
| 271 | }, | 306 | }, |
| 272 | "version": "76434ab6f71d5ecbff8a218ff6bed91ea2bf73b8" | 307 | "version": "8902b3f11413166e7823c377dbf876bae1fab137" |
| 273 | }, | 308 | }, |
| 274 | "xcompose": { | 309 | "xcompose": { |
| 275 | "cargoLocks": null, | 310 | "cargoLocks": null, |
diff --git a/_sources/generated.nix b/_sources/generated.nix index 72e6367c..89857492 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix | |||
| @@ -27,6 +27,18 @@ | |||
| 27 | }); | 27 | }); |
| 28 | date = "2015-09-10"; | 28 | date = "2015-09-10"; |
| 29 | }; | 29 | }; |
| 30 | etebase-py = { | ||
| 31 | pname = "etebase-py"; | ||
| 32 | version = "ac3e5138a2e18dc11f77d9a75f07d4b8dd8c4445"; | ||
| 33 | src = fetchFromGitHub ({ | ||
| 34 | owner = "etesync"; | ||
| 35 | repo = "etebase-py"; | ||
| 36 | rev = "ac3e5138a2e18dc11f77d9a75f07d4b8dd8c4445"; | ||
| 37 | fetchSubmodules = false; | ||
| 38 | sha256 = "sha256-OSzOoL7o4rWYOK1OyxfpslOnNfnK5CKhdhiFEXz/WvY="; | ||
| 39 | }); | ||
| 40 | date = "2022-07-06"; | ||
| 41 | }; | ||
| 30 | lesspipe = { | 42 | lesspipe = { |
| 31 | pname = "lesspipe"; | 43 | pname = "lesspipe"; |
| 32 | version = "2.06"; | 44 | version = "2.06"; |
| @@ -124,6 +136,14 @@ | |||
| 124 | sha256 = "sha256-mMKXzeqg2PfXkvGL7qugOelm/I2fZnUidq6/ugXDHa0="; | 136 | sha256 = "sha256-mMKXzeqg2PfXkvGL7qugOelm/I2fZnUidq6/ugXDHa0="; |
| 125 | }; | 137 | }; |
| 126 | }; | 138 | }; |
| 139 | prometheus-lvm-exporter = { | ||
| 140 | pname = "prometheus-lvm-exporter"; | ||
| 141 | version = "0.3.1"; | ||
| 142 | src = fetchurl { | ||
| 143 | url = "https://github.com/hansmi/prometheus-lvm-exporter/archive/refs/tags/v0.3.1.tar.gz"; | ||
| 144 | sha256 = "sha256-bytPqK2kvDrskbvmyybejUr1+RU6YdOgzmtqbKyfSNA="; | ||
| 145 | }; | ||
| 146 | }; | ||
| 127 | psql-versioning = { | 147 | psql-versioning = { |
| 128 | pname = "psql-versioning"; | 148 | pname = "psql-versioning"; |
| 129 | version = "3e578ff5e5aa6c7e5459dbfa842a64a1b2674b2e"; | 149 | version = "3e578ff5e5aa6c7e5459dbfa842a64a1b2674b2e"; |
| @@ -155,15 +175,15 @@ | |||
| 155 | }; | 175 | }; |
| 156 | v4l2loopback = { | 176 | v4l2loopback = { |
| 157 | pname = "v4l2loopback"; | 177 | pname = "v4l2loopback"; |
| 158 | version = "76434ab6f71d5ecbff8a218ff6bed91ea2bf73b8"; | 178 | version = "8902b3f11413166e7823c377dbf876bae1fab137"; |
| 159 | src = fetchFromGitHub ({ | 179 | src = fetchFromGitHub ({ |
| 160 | owner = "umlaeute"; | 180 | owner = "umlaeute"; |
| 161 | repo = "v4l2loopback"; | 181 | repo = "v4l2loopback"; |
| 162 | rev = "76434ab6f71d5ecbff8a218ff6bed91ea2bf73b8"; | 182 | rev = "8902b3f11413166e7823c377dbf876bae1fab137"; |
| 163 | fetchSubmodules = true; | 183 | fetchSubmodules = true; |
| 164 | sha256 = "sha256-c6g63jW+a+v/TxLD9NnQGn/aUgivwVkxzP+hZ65w2/o="; | 184 | sha256 = "sha256-p/tGXO2+EogR4BdZ+KxonyBnYHznJrqKM6cRg1G37xA="; |
| 165 | }); | 185 | }); |
| 166 | date = "2022-08-05"; | 186 | date = "2022-11-09"; |
| 167 | }; | 187 | }; |
| 168 | xcompose = { | 188 | xcompose = { |
| 169 | pname = "xcompose"; | 189 | pname = "xcompose"; |
diff --git a/hosts/vidhar/prometheus/default.nix b/hosts/vidhar/prometheus/default.nix index 8e5ff0ea..e6de6806 100644 --- a/hosts/vidhar/prometheus/default.nix +++ b/hosts/vidhar/prometheus/default.nix | |||
| @@ -69,6 +69,7 @@ in { | |||
| 69 | "--systemd.collector.enable-ip-accounting" | 69 | "--systemd.collector.enable-ip-accounting" |
| 70 | ]; | 70 | ]; |
| 71 | }; | 71 | }; |
| 72 | lvm.enable = true; | ||
| 72 | blackbox = { | 73 | blackbox = { |
| 73 | enable = true; | 74 | enable = true; |
| 74 | configFile = pkgs.writeText "blackbox-config.yaml" (builtins.toJSON { | 75 | configFile = pkgs.writeText "blackbox-config.yaml" (builtins.toJSON { |
| @@ -104,6 +105,13 @@ in { | |||
| 104 | relabel_configs = relabelHosts; | 105 | relabel_configs = relabelHosts; |
| 105 | scrape_interval = "1s"; | 106 | scrape_interval = "1s"; |
| 106 | } | 107 | } |
| 108 | { job_name = "lvm"; | ||
| 109 | static_configs = [ | ||
| 110 | { targets = ["localhost:${toString config.services.prometheus.exporters.lvm.port}"]; } | ||
| 111 | ]; | ||
| 112 | relabel_configs = relabelHosts; | ||
| 113 | scrape_interval = "5s"; | ||
| 114 | } | ||
| 107 | { job_name = "systemd"; | 115 | { job_name = "systemd"; |
| 108 | static_configs = [ | 116 | static_configs = [ |
| 109 | { targets = ["localhost:${toString config.services.prometheus.exporters.systemd.port}"]; } | 117 | { targets = ["localhost:${toString config.services.prometheus.exporters.systemd.port}"]; } |
diff --git a/modules/prometheus-lvm-exporter.nix b/modules/prometheus-lvm-exporter.nix new file mode 100644 index 00000000..f0951d46 --- /dev/null +++ b/modules/prometheus-lvm-exporter.nix | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | { lib, config, pkgs, utils, ... }: | ||
| 2 | |||
| 3 | with lib; | ||
| 4 | |||
| 5 | let | ||
| 6 | cfg = config.services.prometheus.exporters.lvm; | ||
| 7 | in { | ||
| 8 | options = { | ||
| 9 | services.prometheus.exporters.lvm = { | ||
| 10 | enable = mkEnableOption "Prometheus LVM exporter"; | ||
| 11 | |||
| 12 | listenAddress = mkOption { | ||
| 13 | type = types.str; | ||
| 14 | default = "localhost"; | ||
| 15 | }; | ||
| 16 | port = mkOption { | ||
| 17 | type = types.port; | ||
| 18 | default = 9845; | ||
| 19 | }; | ||
| 20 | |||
| 21 | openFirewall = mkOption { | ||
| 22 | type = types.bool; | ||
| 23 | default = false; | ||
| 24 | description = lib.mdDoc '' | ||
| 25 | Open port in firewall for incoming connections. | ||
| 26 | ''; | ||
| 27 | }; | ||
| 28 | firewallFilter = mkOption { | ||
| 29 | type = types.nullOr types.str; | ||
| 30 | default = null; | ||
| 31 | example = literalExpression '' | ||
| 32 | "-i eth0 -p tcp -m tcp --dport ${toString cfg.port}" | ||
| 33 | ''; | ||
| 34 | description = lib.mdDoc '' | ||
| 35 | Specify a filter for iptables to use when | ||
| 36 | {option}`services.prometheus.exporters.lvm.openFirewall` | ||
| 37 | is true. It is used as `ip46tables -I nixos-fw firewallFilter -j nixos-fw-accept`. | ||
| 38 | ''; | ||
| 39 | }; | ||
| 40 | }; | ||
| 41 | }; | ||
| 42 | |||
| 43 | config = mkIf cfg.enable { | ||
| 44 | systemd.services."prometheus-lvm-exporter" = { | ||
| 45 | wantedBy = [ "multi-user.target" ]; | ||
| 46 | after = [ "network.target" ]; | ||
| 47 | |||
| 48 | serviceConfig = { | ||
| 49 | ExecStart = "${pkgs.prometheus-lvm-exporter}/bin/prometheus-lvm-exporter ${utils.escapeSystemdExecArgs [ | ||
| 50 | "-web.listen-address" "${cfg.listenAddress}:${toString cfg.port}" | ||
| 51 | ]}"; | ||
| 52 | |||
| 53 | Restart = "always"; | ||
| 54 | }; | ||
| 55 | }; | ||
| 56 | }; | ||
| 57 | } | ||
diff --git a/nvfetcher.toml b/nvfetcher.toml index 7cd52c29..5e075ae4 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml | |||
| @@ -68,4 +68,13 @@ fetch.url = "https://github.com/matusnovak/prometheus-smartctl/archive/refs/tags | |||
| 68 | [postfwd] | 68 | [postfwd] |
| 69 | src.github_tag = "postfwd/postfwd" | 69 | src.github_tag = "postfwd/postfwd" |
| 70 | src.prefix = "v" | 70 | src.prefix = "v" |
| 71 | fetch.url = "https://github.com/postfwd/postfwd/archive/refs/tags/v$ver.tar.gz" \ No newline at end of file | 71 | fetch.url = "https://github.com/postfwd/postfwd/archive/refs/tags/v$ver.tar.gz" |
| 72 | |||
| 73 | [etebase-py] | ||
| 74 | src.git = "https://github.com/etesync/etebase-py" | ||
| 75 | fetch.github = "etesync/etebase-py" | ||
| 76 | |||
| 77 | [prometheus-lvm-exporter] | ||
| 78 | src.github = "hansmi/prometheus-lvm-exporter" | ||
| 79 | src.prefix = "v" | ||
| 80 | fetch.url = "https://github.com/hansmi/prometheus-lvm-exporter/archive/refs/tags/v$ver.tar.gz" \ No newline at end of file | ||
diff --git a/overlays/etesync-dav.nix b/overlays/etesync-dav.nix new file mode 100644 index 00000000..49c77352 --- /dev/null +++ b/overlays/etesync-dav.nix | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | { final, prev, sources, ... }: { | ||
| 2 | etesync-dav = let | ||
| 3 | python = final.python3.override { | ||
| 4 | packageOverrides = self: super: { | ||
| 5 | # flask-wtf = super.flask-wtf.overridePythonAttrs (old: rec { | ||
| 6 | # patches = []; | ||
| 7 | # version = "0.15.1"; | ||
| 8 | # src = old.src.override { | ||
| 9 | # inherit version; | ||
| 10 | # sha256 = "ff177185f891302dc253437fe63081e7a46a4e99aca61dfe086fb23e54fff2dc"; | ||
| 11 | # }; | ||
| 12 | # disabledTests = [ | ||
| 13 | # "test_outside_request" | ||
| 14 | # ]; | ||
| 15 | # }); | ||
| 16 | # wtforms = super.wtforms.overridePythonAttrs (old: rec { | ||
| 17 | # version = "2.3.3"; | ||
| 18 | # src = old.src.override { | ||
| 19 | # inherit version; | ||
| 20 | # sha256 = "81195de0ac94fbc8368abbaf9197b88c4f3ffd6c2719b5bf5fc9da744f3d829c"; | ||
| 21 | # }; | ||
| 22 | # checkPhase = '' | ||
| 23 | # ${self.python.interpreter} tests/runtests.py | ||
| 24 | # ''; | ||
| 25 | # }); | ||
| 26 | etebase = super.wtforms.overridePythonAttrs (old: rec { | ||
| 27 | inherit (sources.etebase-py) version src; | ||
| 28 | }); | ||
| 29 | }; | ||
| 30 | }; | ||
| 31 | in python.pkgs.buildPythonApplication rec { | ||
| 32 | pname = "etesync-dav"; | ||
| 33 | version = "0.32.1"; | ||
| 34 | |||
| 35 | src = python.pkgs.fetchPypi { | ||
| 36 | inherit pname version; | ||
| 37 | sha256 = "a4e2ee83932755d29ac39c1e74005ec289880fd2d4d2164f09fe2464a294d720"; | ||
| 38 | }; | ||
| 39 | |||
| 40 | propagatedBuildInputs = with python.pkgs; [ | ||
| 41 | appdirs | ||
| 42 | etebase | ||
| 43 | etesync | ||
| 44 | flask | ||
| 45 | flask-wtf | ||
| 46 | msgpack | ||
| 47 | pysocks | ||
| 48 | (python.pkgs.toPythonModule (final.radicale3.override { python3 = python; })) | ||
| 49 | requests | ||
| 50 | ] ++ requests.optional-dependencies.socks; | ||
| 51 | |||
| 52 | doCheck = false; | ||
| 53 | |||
| 54 | meta = with final.lib; { | ||
| 55 | homepage = "https://www.etesync.com/"; | ||
| 56 | description = "Secure, end-to-end encrypted, and privacy respecting sync for contacts, calendars and tasks"; | ||
| 57 | license = licenses.gpl3; | ||
| 58 | broken = final.stdenv.isDarwin; # pyobjc-framework-Cocoa is missing | ||
| 59 | }; | ||
| 60 | }; | ||
| 61 | } | ||
diff --git a/overlays/prometheus-lvm-exporter.nix b/overlays/prometheus-lvm-exporter.nix new file mode 100644 index 00000000..ead1e820 --- /dev/null +++ b/overlays/prometheus-lvm-exporter.nix | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | { final, prev, sources, ... }: { | ||
| 2 | prometheus-lvm-exporter = final.buildGoModule { | ||
| 3 | pname = "prometheus-lvm-exporter"; | ||
| 4 | inherit (sources.prometheus-lvm-exporter) version src; | ||
| 5 | |||
| 6 | vendorHash = "sha256-DyvUM3pP2P1IGfXKpkR5Y4CVcnSBsnNy0kd3WTjbWpg="; | ||
| 7 | |||
| 8 | doCheck = false; | ||
| 9 | |||
| 10 | nativeBuildInputs = with final; [ makeWrapper ]; | ||
| 11 | |||
| 12 | postInstall = '' | ||
| 13 | wrapProgram $out/bin/prometheus-lvm-exporter \ | ||
| 14 | --set LC_ALL C \ | ||
| 15 | --add-flags -command --add-flags ${final.lvm2.bin}/bin/lvm | ||
| 16 | ''; | ||
| 17 | }; | ||
| 18 | } | ||
