container exporters
This commit is contained in:
1 parent
382628f233
commit
7892912f4d
10 files changed
+47
-37
No files matched your search
@@ -129,7 +129,7 @@ all_functions=$(list_run_functions)
|
||||
for f in ${all_functions[@]}; do
|
||||
if [ "$1" == "$f" ]; then
|
||||
echo -e "Running ${BLUE_BOLD}$1${NC}"
|
||||
run-$1 ${@:2} 2>&1 | sed "s/^/\t│ /"
|
||||
run-$1 ${@:2}
|
||||
ecode=$(echo $?)
|
||||
echo -e "\t└──${NC}DONE ${BLUE_BOLD}$1${NC}"
|
||||
exit $ecode
|
||||
|
||||
+10
-7
@@ -1,4 +1,4 @@
|
||||
{}:
|
||||
{ user }:
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
imports = [ ./hl-bigbox1.hardware-configuration.nix ];
|
||||
@@ -8,9 +8,12 @@
|
||||
skyg.nixos.server.services.jellyfin.enable = true;
|
||||
skyg.nixos.desktop.kde.enabled = true;
|
||||
skyg.nixos.desktop.enabled = false;
|
||||
skyg.server.admin.enable = true;
|
||||
users.users.ari.extraGroups = [ "input" ];
|
||||
# firmware updater
|
||||
skyg.server.admin.enable = true;
|
||||
skyg.server.exporters.enable = true;
|
||||
skyg.nixos.common.containers.openMetricsPort = true;
|
||||
|
||||
users.users.ari.extraGroups = [ "input" ];
|
||||
# firmware updater
|
||||
services.fwupd.enable = true;
|
||||
virtualisation.docker.enableNvidia = true;
|
||||
hardware.nvidia-container-toolkit.enable = true;
|
||||
@@ -64,8 +67,8 @@
|
||||
steam-run
|
||||
steamPackages.steamcmd
|
||||
ollama
|
||||
pkgs.jellyfin
|
||||
pkgs.jellyfin-web
|
||||
pkgs.jellyfin-ffmpeg
|
||||
jellyfin
|
||||
jellyfin-web
|
||||
jellyfin-ffmpeg
|
||||
];
|
||||
}
|
||||
@@ -13,6 +13,8 @@ in
|
||||
skyg.user.enable = true;
|
||||
skyg.nixos.common.ssh-server.enable = true;
|
||||
skyg.server.admin.enable = true;
|
||||
skyg.server.exporters.enable = true;
|
||||
skyg.nixos.common.containers.openMetricsPort = true;
|
||||
|
||||
# Nix Stores
|
||||
services.nix-serve = {
|
||||
@@ -52,12 +54,5 @@ in
|
||||
# Firewall
|
||||
networking.firewall.allowedUDPPorts = openPorts;
|
||||
networking.firewall.allowedTCPPorts = openPorts;
|
||||
# K8s
|
||||
services.kubernetes.kubelet.hostname = "minipc1.lab.internal";
|
||||
skyg.nixos.server.k8s = {
|
||||
enable = true;
|
||||
isMaster = true;
|
||||
isNode = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
imports = [ ./hl-minipc2.hardware-configuration.nix ];
|
||||
skyg.user.enable = true;
|
||||
skyg.nixos.common.ssh-server.enable = true;
|
||||
skyg.server.exporters.enable = true;
|
||||
skyg.nixos.common.containers.openMetricsPort = true;
|
||||
|
||||
# firmware updater
|
||||
services.fwupd.enable = true;
|
||||
# Bootloader.
|
||||
|
||||
@@ -20,6 +20,8 @@ in
|
||||
skyg.user.enable = true;
|
||||
skyg.nixos.common.ssh-server.enable = true;
|
||||
skyg.server.admin.enable = true;
|
||||
skyg.server.exporters.enable = true;
|
||||
|
||||
# firmware updater
|
||||
services.fwupd.enable = true;
|
||||
# Bootloader.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [
|
||||
./docker.nix
|
||||
@@ -9,18 +7,23 @@ with lib;
|
||||
];
|
||||
options = {
|
||||
skyg.nixos.common.containers = {
|
||||
runtime = mkOption {
|
||||
runtime = lib.mkOption {
|
||||
description = "Docker vs podman";
|
||||
type = types.str;
|
||||
type = lib.types.str;
|
||||
default = "docker";
|
||||
};
|
||||
enableOnBoot = mkOption {
|
||||
type = types.bool;
|
||||
enableOnBoot = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
localDockerRegistries = mkOption {
|
||||
type = types.listOf types.str;
|
||||
localDockerRegistries = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
};
|
||||
metricsPort = lib.mkOption {
|
||||
type = lib.types.number;
|
||||
default = 9323;
|
||||
};
|
||||
openMetricsPort = lib.mkEnableOption "Open container metrics port";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -12,10 +12,20 @@ in
|
||||
liveRestore = false;
|
||||
daemon.settings = {
|
||||
insecure-registries = cfg.localDockerRegistries;
|
||||
metrics-addr = "127.0.0.1:${toString cfg.metricsPort}";
|
||||
};
|
||||
};
|
||||
environment.systemPackages = with pkgs; [ docker-compose ];
|
||||
users.users.${config.skyg.user.name}.extraGroups = [ "docker" ];
|
||||
virtualisation.oci-containers.backend = "docker";
|
||||
networking.firewall.allowedUDPPorts =
|
||||
(if cfg.openMetricsPort then [
|
||||
cfg.metricsPort
|
||||
] else [ ]);
|
||||
networking.firewall.allowedTCPPorts =
|
||||
(if cfg.openMetricsPort then [
|
||||
cfg.metricsPort
|
||||
] else [ ]);
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,16 +1,13 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.skyg.core;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
skyg.core = {
|
||||
hostName = mkOption {
|
||||
hostName = lib.mkOption {
|
||||
description = "Machine Hostname";
|
||||
type = types.str;
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.skyg.nixos.common.ssh-server;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
skyg.nixos.common.ssh-server = {
|
||||
enable = mkEnableOption
|
||||
enable = lib.mkEnableOption
|
||||
"enable ssh server";
|
||||
masterPubKey = mkOption {
|
||||
type = types.str;
|
||||
masterPubKey = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let cfg = config.skyg.server.exporters;
|
||||
in {
|
||||
options = {
|
||||
skyg.server.exporters = {
|
||||
enable = mkEnableOption
|
||||
enable = lib.mkEnableOption
|
||||
"Enable Special prom exporters for servers";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.prometheus.exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
|
||||
Reference in new issue
Block a user