updates and stuff
This commit is contained in:
28
hosts/nas/apps/paperless-ai/default.nix
Normal file
28
hosts/nas/apps/paperless-ai/default.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.paperless-ai;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
virtualisation.oci-containers.containers.${cfg.name} = {
|
||||
autoStart = true;
|
||||
image = cfg.image;
|
||||
extraOptions = [ "--device=nvidia.com/gpu=0" "--network=bridge" "--add-host=host.docker.internal:host-gateway" ];
|
||||
volumes = [ "${cfg.configPath}:/app/data" ];
|
||||
ports = [ "${cfg.port}:3000" ];
|
||||
environment = {
|
||||
NVIDIA_VISIBLE_DEVICES = "all";
|
||||
NVIDIA_DRIVER_CAPABILITIES = "all";
|
||||
PAPERLESS_API_URL = "http://10.0.1.20:28981";
|
||||
PAPERLESS_API_TOKEN = "6f26e1a4632f23bc2da5b74c799ccbda18fa8022";
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
47
hosts/nas/apps/paperless-ai/options.nix
Normal file
47
hosts/nas/apps/paperless-ai/options.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.nas-apps.paperless-ai = {
|
||||
enable = mkEnableOption "paperless-ai docker service";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.str;
|
||||
default = "3000";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "paperless-ai";
|
||||
};
|
||||
|
||||
image = mkOption {
|
||||
type = types.str;
|
||||
default = "clusterzx/paperless-ai";
|
||||
};
|
||||
|
||||
configPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/media/nas/ssd/nix-app-data/paperless-ai";
|
||||
};
|
||||
|
||||
puid = mkOption {
|
||||
type = types.str;
|
||||
default = "911";
|
||||
};
|
||||
|
||||
pgid = mkOption {
|
||||
type = types.str;
|
||||
default = "1000";
|
||||
};
|
||||
|
||||
timeZone = mkOption {
|
||||
type = types.str;
|
||||
default = "America/Chicago";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user