Compare commits
1 Commits
errorpages
...
create-fla
Author | SHA1 | Date | |
---|---|---|---|
b4aada6fbc |
@@ -1,4 +1,9 @@
|
|||||||
{ pkgs, lib, fp, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
fp,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@@ -8,6 +13,7 @@
|
|||||||
./networking.nix
|
./networking.nix
|
||||||
./nix.nix
|
./nix.nix
|
||||||
./vm.nix
|
./vm.nix
|
||||||
|
./flake-input-exporter.nix
|
||||||
|
|
||||||
./services/acme.nix
|
./services/acme.nix
|
||||||
./services/uptimed.nix
|
./services/uptimed.nix
|
||||||
|
40
base/flake-input-exporter.nix
Normal file
40
base/flake-input-exporter.nix
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
data = lib.flip lib.mapAttrs inputs (
|
||||||
|
name: input: {
|
||||||
|
inherit (input)
|
||||||
|
lastModified
|
||||||
|
;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
folder = pkgs.writeTextDir "share/flake-inputs" (
|
||||||
|
lib.concatMapStringsSep "\n" (
|
||||||
|
{ name, value }:
|
||||||
|
"nixos_last_modified_input{flake=${name},host=${config.networking.hostName}} ${toString value.lastModified}"
|
||||||
|
) (lib.attrsToList data)
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.nginx.virtualHosts."${config.networking.fqdn}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
kTLS = true;
|
||||||
|
serverAliases = [
|
||||||
|
"${config.networking.hostName}.pvv.org"
|
||||||
|
];
|
||||||
|
locations."/metrics" = {
|
||||||
|
root = "${folder}/share";
|
||||||
|
};
|
||||||
|
extraConfig = ''
|
||||||
|
allow 129.241.210.128/25;
|
||||||
|
allow 2001:700:300:1900::/64;
|
||||||
|
deny all;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user