chore: some cleaning + logging implementation
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
{ pkgs, containersMapping, ... }:
|
||||
let
|
||||
infra = import ../infra/constants.nix;
|
||||
in
|
||||
{
|
||||
# OPTIONAL int cores: number of CPU (default = 1)
|
||||
cores = 2;
|
||||
|
||||
# OPTIONAL int memory: RAM memory (default 512)
|
||||
memory = 512;
|
||||
|
||||
# OPTIONAL string disk: disk space (default "4G") - beware, NixOS is greedy
|
||||
disk = "4G";
|
||||
|
||||
# OPTIONAL string swap: swap space (default null)
|
||||
swap = null;
|
||||
|
||||
# OPTIONAL list of int ports: ports to open (TCP tho) (default [])
|
||||
ports = [ 80 ];
|
||||
|
||||
# OPTIONAL submodule services: services to be passed to the NixOS Module (default {})
|
||||
services = {
|
||||
nginx.enable = true;
|
||||
};
|
||||
|
||||
# OPTIONAL list of pkgs other_packages: packages to add to eenvironment.systemPackages (default [])
|
||||
other_packages = [ pkgs.hello ];
|
||||
|
||||
# OPTIONAL submodule etc: files contents to pass to eenvironment.etc
|
||||
etc."alloy/log-myservice.alloy" = ''
|
||||
# logger_ip = ${infra.build_ip containersMapping.grafana}
|
||||
# prometheus = ${infra.build_ip containersMapping.prometheus}
|
||||
'';
|
||||
|
||||
# OPTIONAL bool logging.enable: whether to enable the Alloy configuration (=> Loki)
|
||||
# Need further configuration in etc."alloy/log-myservice.alloy"
|
||||
logging.enable = true;
|
||||
|
||||
# OPTIONAL bool logging.metrics.enable: whether to enable the Alloy metrics configuration (=> Prometheus)
|
||||
logging.metrics.enable = true;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
|
||||
containerBuild = import ../lib/containers.nix;
|
||||
containerBuild = import ../lib/container_build.nix;
|
||||
|
||||
containersFiles = builtins.readDir ./.;
|
||||
|
||||
@@ -10,7 +10,7 @@ let
|
||||
lib.mapAttrs (
|
||||
name: type:
|
||||
if type == "regular" && name != "default.nix" && lib.hasSuffix ".nix" name then
|
||||
import ./${name} { inherit containersMapping pkgs; }
|
||||
import ./${name} { inherit name containersMapping pkgs; }
|
||||
else
|
||||
null
|
||||
) containersFiles
|
||||
@@ -26,7 +26,7 @@ let
|
||||
hostname = hostname;
|
||||
container_id = containersMapping.${hostname};
|
||||
};
|
||||
result = containerBuild { inherit def; };
|
||||
result = containerBuild { inherit def lib; };
|
||||
in
|
||||
{
|
||||
name = hostname;
|
||||
|
||||
Reference in New Issue
Block a user