move stuff
This commit is contained in:
39
modules/nixos/services/lubelogger/default.nix
Normal file
39
modules/nixos/services/lubelogger/default.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.services.lubelogger;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
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"
|
||||
];
|
||||
environmentFiles = [
|
||||
"/media/nas/main/nix-app-data/lubelogger/lubelogger.env"
|
||||
];
|
||||
environment = {
|
||||
PUID = toString config.users.users.nix-apps.uid;
|
||||
PGID = toString config.users.groups.jallen-nas.gid;
|
||||
TZ = "America/Chicago";
|
||||
};
|
||||
};
|
||||
|
||||
# Open firewall for lubelogger if enabled
|
||||
networking.firewall = mkIf cfg.openFirewall {
|
||||
allowedTCPPorts = [ cfg.port ];
|
||||
allowedUDPPorts = [ cfg.port ];
|
||||
};
|
||||
};
|
||||
}
|
||||
19
modules/nixos/services/lubelogger/options.nix
Normal file
19
modules/nixos/services/lubelogger/options.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ 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