Compare commits

...

4 Commits

Author SHA1 Message Date
8700e78752
Remove deprecated routeConfig
Some checks failed
Run nix flake check / flake-check (push) Failing after 11m42s
2024-12-01 02:00:57 +01:00
82135bcfbc
flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/0c5b4ecbed5b155b705336aa96d878e55acd8685?narHash=sha256-T38FQOg0BV5M8FN1712fovzNakSOENEYs%2BCSkg31C9Y%3D' (2024-11-27)
  → 'github:nixos/nixpkgs/c71ad5c34d51dcbda4c15f44ea4e4aa6bb6ac1e9?narHash=sha256-fYNXgpu1AEeLyd3fQt4Ym0tcVP7cdJ8wRoqJ%2BCtTRyY%3D' (2024-11-28)
2024-12-01 01:53:02 +01:00
fcfafa03fa
Switch nixpkgs to 24.11 2024-12-01 01:52:27 +01:00
3c3eaaa042
Add monitoring host 2024-12-01 01:51:34 +01:00
22 changed files with 177 additions and 18 deletions

View File

@ -9,6 +9,7 @@ keys:
- &server_inc1 age1g5luz2rtel3surgzuh62rkvtey7lythrvfenyq954vmeyfpxjqkqdj3wt8 - &server_inc1 age1g5luz2rtel3surgzuh62rkvtey7lythrvfenyq954vmeyfpxjqkqdj3wt8
- &server_http-proxy age1gq8434ku0xekqmvnseeunv83e779cg03c06gwrusnymdsr3rpufqx6vr3m - &server_http-proxy age1gq8434ku0xekqmvnseeunv83e779cg03c06gwrusnymdsr3rpufqx6vr3m
- &server_ca age1288993th0ge00reg4zqueyvmkrsvk829cs068eekjqfdprsrkeqql7mljk - &server_ca age1288993th0ge00reg4zqueyvmkrsvk829cs068eekjqfdprsrkeqql7mljk
- &server_monitoring01 age1vpns76ykll8jgdlu3h05cur4ew2t3k7u03kxdg8y6ypfhsfhq9fqyurjey
creation_rules: creation_rules:
- path_regex: secrets/[^/]+\.(yaml|json|env|ini) - path_regex: secrets/[^/]+\.(yaml|json|env|ini)
key_groups: key_groups:
@ -23,6 +24,7 @@ creation_rules:
- *server_inc1 - *server_inc1
- *server_http-proxy - *server_http-proxy
- *server_ca - *server_ca
- *server_monitoring01
- path_regex: secrets/ns3/[^/]+\.(yaml|json|env|ini) - path_regex: secrets/ns3/[^/]+\.(yaml|json|env|ini)
key_groups: key_groups:
- age: - age:
@ -33,6 +35,11 @@ creation_rules:
- age: - age:
- *admin_torjus - *admin_torjus
- *server_ca - *server_ca
- path_regex: secrets/monitoring01/[^/]+\.(yaml|json|env|ini)
key_groups:
- age:
- *admin_torjus
- *server_monitoring01
- path_regex: secrets/ca/keys/.+ - path_regex: secrets/ca/keys/.+
key_groups: key_groups:
- age: - age:

View File

@ -23,16 +23,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1732749044, "lastModified": 1732824227,
"narHash": "sha256-T38FQOg0BV5M8FN1712fovzNakSOENEYs+CSkg31C9Y=", "narHash": "sha256-fYNXgpu1AEeLyd3fQt4Ym0tcVP7cdJ8wRoqJ+CtTRyY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0c5b4ecbed5b155b705336aa96d878e55acd8685", "rev": "c71ad5c34d51dcbda4c15f44ea4e4aa6bb6ac1e9",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-24.05", "ref": "nixos-24.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@ -2,7 +2,7 @@
description = "Homelab v5 Nixos Server Configurations"; description = "Homelab v5 Nixos Server Configurations";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
sops-nix = { sops-nix = {
@ -215,6 +215,22 @@
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
]; ];
}; };
monitoring01 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/monitoring01
sops-nix.nixosModules.sops
];
};
}; };
}; };
} }

View File

@ -35,7 +35,7 @@
"10.69.13.12/24" "10.69.13.12/24"
]; ];
routes = [ routes = [
{ routeConfig.Gateway = "10.69.13.1"; } { Gateway = "10.69.13.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -33,7 +33,7 @@
"10.69.13.9/24" "10.69.13.9/24"
]; ];
routes = [ routes = [
{ routeConfig.Gateway = "10.69.13.1"; } { Gateway = "10.69.13.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -35,7 +35,7 @@
"10.69.13.11/24" "10.69.13.11/24"
]; ];
routes = [ routes = [
{ routeConfig.Gateway = "10.69.13.1"; } { Gateway = "10.69.13.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -45,7 +45,7 @@
VLAN = [ "enp2s0.13" ]; VLAN = [ "enp2s0.13" ];
}; };
routes = [ routes = [
{ routeConfig.Gateway = "10.69.12.1"; } { Gateway = "10.69.12.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -45,7 +45,7 @@
VLAN = [ "enp2s0.13" ]; VLAN = [ "enp2s0.13" ];
}; };
routes = [ routes = [
{ routeConfig.Gateway = "10.69.12.1"; } { Gateway = "10.69.12.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -29,7 +29,7 @@
"10.69.13.10/24" "10.69.13.10/24"
]; ];
routes = [ routes = [
{ routeConfig.Gateway = "10.69.13.1"; } { Gateway = "10.69.13.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -0,0 +1,62 @@
{
pkgs,
...
}:
{
imports = [
../template/hardware-configuration.nix
../../system
];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
boot.loader.grub = {
enable = true;
device = "/dev/sda";
configurationLimit = 3;
};
networking.hostName = "monitoring01";
networking.domain = "home.2rjus.net";
networking.useNetworkd = true;
networking.useDHCP = false;
services.resolved.enable = true;
networking.nameservers = [
"10.69.13.5"
"10.69.13.6"
];
systemd.network.enable = true;
systemd.network.networks."ens18" = {
matchConfig.Name = "ens18";
address = [
"10.69.13.13/24"
];
routes = [
{ Gateway = "10.69.13.1"; }
];
linkConfig.RequiredForOnline = "routable";
};
time.timeZone = "Europe/Oslo";
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.settings.tarball-ttl = 0;
environment.systemPackages = with pkgs; [
vim
wget
git
];
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./configuration.nix
../../services/monitoring
];
}

View File

@ -30,7 +30,7 @@
"10.69.13.10/24" "10.69.13.10/24"
]; ];
routes = [ routes = [
{ routeConfig.Gateway = "10.69.13.1"; } { Gateway = "10.69.13.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -32,7 +32,7 @@
"10.69.13.5/24" "10.69.13.5/24"
]; ];
routes = [ routes = [
{ routeConfig.Gateway = "10.69.13.1"; } { Gateway = "10.69.13.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -32,7 +32,7 @@
"10.69.13.6/24" "10.69.13.6/24"
]; ];
routes = [ routes = [
{ routeConfig.Gateway = "10.69.13.1"; } { Gateway = "10.69.13.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -32,7 +32,7 @@
"10.69.13.7/24" "10.69.13.7/24"
]; ];
routes = [ routes = [
{ routeConfig.Gateway = "10.69.13.1"; } { Gateway = "10.69.13.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -32,7 +32,7 @@
"10.69.13.8/24" "10.69.13.8/24"
]; ];
routes = [ routes = [
{ routeConfig.Gateway = "10.69.13.1"; } { Gateway = "10.69.13.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -28,7 +28,7 @@
"10.69.8.250/24" "10.69.8.250/24"
]; ];
routes = [ routes = [
{ routeConfig.Gateway = "10.69.8.1"; } { Gateway = "10.69.8.1"; }
]; ];
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View File

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./loki.nix
./grafana.nix
];
}

View File

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
services.grafana = {
enable = true;
settings = {
server = {
http_addr = "";
};
};
};
}

View File

@ -0,0 +1,42 @@
{ ... }:
{
services.loki = {
enable = true;
configuration = {
auth_enabled = false;
server = {
http_listen_port = 3100;
};
common = {
ring = {
instance_addr = "127.0.0.1";
kvstore = {
store = "inmemory";
};
};
replication_factor = 1;
path_prefix = "/var/lib/loki";
};
schema_config = {
configs = [
{
from = "2024-01-01";
store = "tsdb";
object_store = "filesystem";
schema = "v13";
index = {
prefix = "loki_index_";
period = "24h";
};
}
];
};
storage_config = {
filesystem = {
directory = "/var/lib/loki/chunks";
};
};
};
};
}

View File

@ -0,0 +1,6 @@
{ ... }:
{
services.prometheus = {
enable = true;
};
}

View File

@ -1,7 +1,7 @@
$ORIGIN home.2rjus.net. $ORIGIN home.2rjus.net.
$TTL 1800 $TTL 1800
@ IN SOA ns1.home.2rjus.net. admin.test.2rjus.net. ( @ IN SOA ns1.home.2rjus.net. admin.test.2rjus.net. (
2041 ; serial number 2042 ; serial number
3600 ; refresh 3600 ; refresh
900 ; retry 900 ; retry
1209600 ; expire 1209600 ; expire
@ -62,6 +62,7 @@ sonarr IN CNAME http-proxy
ha IN CNAME http-proxy ha IN CNAME http-proxy
z2m IN CNAME http-proxy z2m IN CNAME http-proxy
ca IN A 10.69.13.12 ca IN A 10.69.13.12
monitoring01 IN A 10.69.13.13
; 22_WLAN ; 22_WLAN
unifi-ctrl IN A 10.69.22.5 unifi-ctrl IN A 10.69.22.5