This commit is contained in:
mjallen18
2024-07-26 11:04:46 -05:00
parent 1fc8f0217d
commit bf7671871e
12 changed files with 58 additions and 231 deletions

View File

@@ -0,0 +1,29 @@
{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.nas-apps.beszel;
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.httpPort}:8090" ];
volumes = [
"${cfg.configPath}:/beszel_data"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
}

View File

@@ -0,0 +1,47 @@
{ lib, ... }:
with lib;
{
options.nas-apps.beszel = {
enable = mkEnableOption "beszel docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
httpPort = mkOption {
type = types.str;
default = "8090";
};
name = mkOption {
type = types.str;
default = "beszel";
};
image = mkOption {
type = types.str;
default = "henrygd/beszel";
};
configPath = mkOption {
type = types.str;
default = "/media/nas/ssd/nix-app-data/beszel";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
};
}