container exporters

This commit is contained in:
ari committed 2024-11-11 15:13:16 -05:00
1 parent 382628f233
commit 7892912f4d
10 files changed
+47 -37

No files matched your search

+11 -8
View File
@@ -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 [ ]);
};
}
+2 -5
View File
@@ -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;
};
};
};
+4 -6
View File
@@ -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;
+2 -3
View File
@@ -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;