mkModule various
This commit is contained in:
@@ -6,22 +6,24 @@
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.services.lubelogger;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
name = "lubelogger";
|
||||
cfg = config.${namespace}.services.${name};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
lubeloggerConfig = lib.${namespace}.mkModule {
|
||||
inherit config name;
|
||||
description = "lubelogger";
|
||||
options = { };
|
||||
moduleConfig = {
|
||||
virtualisation.oci-containers.containers.lubelogger = {
|
||||
autoStart = true;
|
||||
image = "ghcr.io/hargata/lubelogger";
|
||||
ports = [ "${toString cfg.port}:8080" ];
|
||||
volumes = [
|
||||
"/media/nas/main/nix-app-data/lubelogger:/App/data"
|
||||
"/media/nas/main/nix-app-data/lubelogger/keys:/root/.aspnet/DataProtection-Keys"
|
||||
"${cfg.configDir}/lubelogger:/App/data"
|
||||
"${cfg.configDir}/lubelogger/keys:/root/.aspnet/DataProtection-Keys"
|
||||
];
|
||||
environmentFiles = [
|
||||
"/media/nas/main/nix-app-data/lubelogger/lubelogger.env"
|
||||
"${cfg.configDir}/lubelogger/lubelogger.env"
|
||||
];
|
||||
environment = {
|
||||
PUID = toString config.users.users.nix-apps.uid;
|
||||
@@ -29,11 +31,9 @@ in
|
||||
TZ = "America/Chicago";
|
||||
};
|
||||
};
|
||||
|
||||
# Open firewall for lubelogger if enabled
|
||||
networking.firewall = mkIf cfg.openFirewall {
|
||||
allowedTCPPorts = [ cfg.port ];
|
||||
allowedUDPPorts = [ cfg.port ];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ lubeloggerConfig ];
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{ lib, namespace, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.services.lubelogger = {
|
||||
enable = mkEnableOption "enable lubelogger";
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 6754;
|
||||
description = "Port for lubelogger web interface";
|
||||
};
|
||||
|
||||
openFirewall = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Whether to open firewall for lubelogger";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user