mkModule gitea
This commit is contained in:
@@ -6,23 +6,29 @@
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.services.free-games-claimer;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
name = "free-games-claimer";
|
||||
cfg = config.${namespace}.services.${name};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
autoStart = cfg.autoStart;
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.httpPort}:6080" ];
|
||||
volumes = [ "${cfg.dataPath}:/fgc/data" ];
|
||||
environmentFiles = [ config.sops.templates."fgc.env".path ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
fgcConfig = lib.${namespace}.mkModule {
|
||||
inherit config name;
|
||||
description = "free-games-claimer";
|
||||
options = { };
|
||||
moduleConfig = {
|
||||
virtualisation.oci-containers.containers."${name}" = {
|
||||
autoStart = true;
|
||||
image = "ghcr.io/vogler/free-games-claimer";
|
||||
ports = [ "${toString cfg.port}:6080" ];
|
||||
volumes = [ "${cfg.configDir}/free-games-claimer:/fgc/data" ];
|
||||
environmentFiles = [ config.sops.templates."fgc.env".path ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ fgcConfig ];
|
||||
}
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
{ lib, namespace, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.services.free-games-claimer = {
|
||||
enable = mkEnableOption "free-games-claimer docker service";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
httpPort = mkOption {
|
||||
type = types.str;
|
||||
default = "6080";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "free-games-claimer";
|
||||
};
|
||||
|
||||
image = mkOption {
|
||||
type = types.str;
|
||||
default = "ghcr.io/vogler/free-games-claimer";
|
||||
};
|
||||
|
||||
dataPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/media/nas/main/nix-app-data/free-games-claimer";
|
||||
};
|
||||
|
||||
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