This commit is contained in:
mjallen18
2024-06-11 11:38:20 -05:00
parent 6a561c0def
commit 7adfefae12
4 changed files with 85 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,52 @@
{ lib, ... }:
with lib;
{
options.nas-apps.puter = {
enable = mkEnableOption "puter docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
httpPort = mkOption {
type = types.str;
default = "4100";
};
name = mkOption {
type = types.str;
default = "puter";
};
image = mkOption {
type = types.str;
default = "ghcr.io/heyputer/puter";
};
configPath = mkOption {
type = types.str;
default = "/home/admin/ssd/ssd_app_data/puter/config";
};
dataPath = mkOption {
type = types.str;
default = "/home/admin/ssd/ssd_app_data/puter/data";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
};
}

View File

@@ -15,6 +15,7 @@
./apps/ollama
./apps/open-webui
./apps/orca-slicer
./apps/puter
./apps/radarr
./apps/sabnzbd
./apps/sonarr