diff options
-rw-r--r-- | data/aliases.nix | 1 | ||||
-rw-r--r-- | flake.lock | 73 | ||||
-rw-r--r-- | flake.nix | 13 | ||||
-rw-r--r-- | machines/firelink.nix | 17 | ||||
-rw-r--r-- | modules/monitoring.nix | 5 |
5 files changed, 68 insertions, 41 deletions
diff --git a/data/aliases.nix b/data/aliases.nix index ce48033..e41bac5 100644 --- a/data/aliases.nix +++ b/data/aliases.nix @@ -57,5 +57,6 @@ rec { port = 11115; }; hledger-web = { port = 11116; }; + prometheus-pms7003-exporter = { port = 11117; }; }; } @@ -1,33 +1,33 @@ { "nodes": { - "home-manager": { + "naersk": { "inputs": { "nixpkgs": [ + "pms7003", "nixpkgs" ] }, "locked": { - "lastModified": 1634851225, - "narHash": "sha256-fwtGHHl7fTELucIRBKO5JORD8QP9Lo9PwY9nrJuEybE=", - "owner": "rycee", - "repo": "home-manager", - "rev": "cfe82d9f444a1b77f135070f1c1ee63fa061f2fd", + "lastModified": 1636103400, + "narHash": "sha256-6DRg/0P9oT5I/V02sloqGVHf8F6f+7DFoBZNPdr+hOI=", + "owner": "nmattia", + "repo": "naersk", + "rev": "074d81b1a45145f076b2adf93184073fc9615397", "type": "github" }, "original": { - "owner": "rycee", - "ref": "master", - "repo": "home-manager", + "owner": "nmattia", + "repo": "naersk", "type": "github" } }, "nixos-hardware": { "locked": { - "lastModified": 1633793047, - "narHash": "sha256-XSMlHMVPKwcEqyHGdFj/ZeGMeZeKNwVExOfLlxcg4oE=", + "lastModified": 1636317251, + "narHash": "sha256-u1cWvvtGH5mfGkeIKrqw2usk4IL7wDiRcnJkUSiZq3Q=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "3aabf78bfcae62f5f99474f2ebbbe418f1c6e54f", + "rev": "fd6f34afcf062761fb5035230f6297752bfedcba", "type": "github" }, "original": { @@ -39,11 +39,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1634758644, - "narHash": "sha256-H3UW/msC6wadg28lcgZv2Ge/P7dWxesL6i37a0GOeyM=", + "lastModified": 1636552551, + "narHash": "sha256-k7Hq/bvUnRlAfFjPGuw3FsSqqspQdRHsCHpgadw6UkQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "70904d4a9927a4d6e05c72c4aaac4370e05107f3", + "rev": "9e86f5f7a19db6da2445f07bafa6694b556f9c6d", "type": "github" }, "original": { @@ -55,11 +55,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1634782485, - "narHash": "sha256-psfh4OQSokGXG0lpq3zKFbhOo3QfoeudRcaUnwMRkQo=", + "lastModified": 1636623366, + "narHash": "sha256-jOQMlv9qFSj0U66HB+ujZoapty0UbewmSNbX8+3ujUQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "34ad3ffe08adfca17fcb4e4a47bb5f3b113687be", + "rev": "c5ed8beb478a8ca035f033f659b60c89500a3034", "type": "github" }, "original": { @@ -69,12 +69,45 @@ "type": "github" } }, + "pms7003": { + "inputs": { + "naersk": "naersk", + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "narHash": "sha256-Lq0q6kFfvG3jSAPEUxftaWHT71Yk0m9MUjcbmypYBYQ=", + "path": "/home/orbekk/projects/pms7003", + "type": "path" + }, + "original": { + "path": "/home/orbekk/projects/pms7003", + "type": "path" + } + }, "root": { "inputs": { - "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable" + "nixpkgs-unstable": "nixpkgs-unstable", + "pms7003": "pms7003" + } + }, + "utils": { + "locked": { + "lastModified": 1634851050, + "narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c91f3de5adaf1de973b797ef7485e441a65b8935", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" } } }, @@ -2,20 +2,25 @@ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05"; inputs.nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - inputs.home-manager.url = "github:rycee/home-manager/master"; - inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs"; + inputs.pms7003.url = "github:orbekk/pms7003/master"; + inputs.pms7003.inputs.nixpkgs.follows = "nixpkgs"; # TODO: Remove nix overlay when pull request is resolved: # https://github.com/NixOS/nix/pull/4566 # inputs.nix.url = "github:orbekk/nix/master"; # inputs.nix.inputs.nixpkgs.follows = "nixpkgs"; - outputs = { self, nixpkgs, nixpkgs-unstable, nixos-hardware, home-manager }: + outputs = { self, nixpkgs, nixpkgs-unstable, nixos-hardware, pms7003 }: let pkgs-module = { config, ... }: let cfg = config.nixpkgs; + ppp = pms7003; + extra-packages = final: prev: { + pms7003 = ppp.packages.${final.system}.pms7003; + }; + unstable-overlay = final: prev: { unstable = import nixpkgs-unstable { inherit (cfg) config localSystem crossSystem; @@ -24,7 +29,7 @@ in { nixpkgs.pkgs = import nixpkgs { inherit (cfg) config localSystem crossSystem; - overlays = cfg.overlays ++ [ unstable-overlay ]; + overlays = cfg.overlays ++ [ unstable-overlay extra-packages ]; }; }; diff --git a/machines/firelink.nix b/machines/firelink.nix index dbcf49d..a32b843 100644 --- a/machines/firelink.nix +++ b/machines/firelink.nix @@ -1,26 +1,16 @@ { config, pkgs, lib, ... }: let + aliases = import ../data/aliases.nix; my-overlay = self: super: { - my-linuxPackages = let linuxPkgs = super.unstable.linuxPackages_latest; - in linuxPkgs.extend (self: super: - { - # xpadneo = super.xpadneo.overrideAttrs (o: rec { - # version = "master"; - # src = pkgs.fetchFromGitHub { - # owner = "atar-axis"; - # repo = "xpadneo"; - # rev = "bf8a3c3d7e28162d074744539d0b228566cb0e32"; - # sha256 = "0hspmvghr3qi1wf17xwfhd5wy7z1rdzh6qhwlhwgfv21f02n2xs9"; - # }; - # }); - }); + my-linuxPackages = super.unstable.linuxPackages_latest; }; in { orbekk.gaming.enable = true; orbekk.desktop.enable = true; orbekk.builder.enableRemoteBuilds = true; orbekk.rtc-wakeup.enable = true; + orbekk.pms7003-exporter.enable = true; # Don't run gc on startup. nix.gc.persistent = false; @@ -30,6 +20,7 @@ in { 4713 69 22 + aliases.services.prometheus-snmp-exporter.port ]; orbekk.simple-firewall.allowedUDPPorts = [ # avahi diff --git a/modules/monitoring.nix b/modules/monitoring.nix index fbbc66e..a4ead4b 100644 --- a/modules/monitoring.nix +++ b/modules/monitoring.nix @@ -70,6 +70,7 @@ in services.prometheus = { enable = true; port = cfg.prometheus-port; + retentionTime = "730d"; scrapeConfigs = [ { @@ -94,10 +95,6 @@ in ]; exporters = { - # smokeping = { - # enable = true; - # hosts = ["google.com"]; - # }; node = { enable = true; enabledCollectors = [ "systemd" ]; |