Add transmute
This commit is contained in:
1 parent
65f278e02f
commit
73ec97cf3a
4 files changed
+121
No files matched your search
@@ -0,0 +1,27 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
cfg = config.selfhosted.converter;
|
||||
in
|
||||
{
|
||||
imports = [ ./transmute ];
|
||||
|
||||
options.selfhosted.converter = {
|
||||
enable = mkEnableOption "Enable ${cfg.targetName} root target";
|
||||
targetName = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.targets."${common.backend}-${cfg.targetName}" = {
|
||||
unitConfig = {
|
||||
Description = "Root target for ${cfg.targetName}";
|
||||
};
|
||||
wantedBy = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
||||
partOf = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
||||
after = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
rootCfg = config.selfhosted.converter;
|
||||
cfg = rootCfg.transmute;
|
||||
domain = "${config.sops.placeholder."domains/serv"}";
|
||||
pocketIdSubdomain = config.selfhosted.pocket-id.subdomain;
|
||||
in
|
||||
{
|
||||
config = mkIf rootCfg.enable {
|
||||
sops.secrets = {
|
||||
"transmute/client_secret" = { };
|
||||
};
|
||||
|
||||
sops.templates."transmute.env".content = ''
|
||||
APP_URL=https://${cfg.subdomain}.${domain}
|
||||
OIDC_AUTO_LAUNCH=false
|
||||
OIDC_ISSUER_URL=https://${pocketIdSubdomain}.${domain}
|
||||
OIDC_CLIENT_ID=transmute
|
||||
OIDC_CLIENT_SECRET=${config.sops.placeholder."transmute/client_secret"}
|
||||
OIDC_DISPLAY_NAME=PocketID
|
||||
OIDC_USERNAME_CLAIM=preferred_username
|
||||
OIDC_AUTO_CREATE_USERS=true
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
rootCfg = config.selfhosted.converter;
|
||||
cfg = rootCfg.transmute;
|
||||
hostDataPath = "${common.dataDir}/transmute";
|
||||
in
|
||||
{
|
||||
imports = [ ./config.nix ];
|
||||
|
||||
options.selfhosted.converter.transmute = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
subdomain = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
hostHttpPort = mkOption {
|
||||
type = types.port;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf rootCfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
image = "ghcr.io/transmute-app/transmute:v2.1.1";
|
||||
ports = [
|
||||
"0.0.0.0:${toString cfg.hostHttpPort}:3313"
|
||||
];
|
||||
environmentFiles = [ config.sops.templates."transmute.env".path ];
|
||||
volumes = [
|
||||
"${hostDataPath}/data:/app/data"
|
||||
];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
||||
"--network=${common.network.name}"
|
||||
"--health-cmd=wget -q -O /dev/null --tries=1 http://localhost:3313/api/health/ready"
|
||||
"--health-interval=30s"
|
||||
"--health-timeout=10s"
|
||||
"--health-retries=3"
|
||||
"--health-start-period=40s"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."${common.backend}-${cfg.name}" = {
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 90 "always";
|
||||
};
|
||||
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
preStart = ''
|
||||
mkdir -p ${hostDataPath}/data
|
||||
chown -R ${common.user.uid}:${common.group.gid} ${hostDataPath}
|
||||
chmod -R 0775 ${hostDataPath}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -11,6 +11,7 @@ let
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./converter
|
||||
./gitea
|
||||
./homarr
|
||||
./immich
|
||||
@@ -93,6 +94,15 @@ in
|
||||
gid = "1000";
|
||||
};
|
||||
};
|
||||
converter = {
|
||||
enable = true;
|
||||
targetName = "converter";
|
||||
transmute = {
|
||||
name = "transmute";
|
||||
subdomain = "convert";
|
||||
hostHttpPort = 6010;
|
||||
};
|
||||
};
|
||||
jellyfin = {
|
||||
enable = false;
|
||||
targetName = "jellyfin";
|
||||
|
||||
Reference in new issue
Block a user