WIP
This commit is contained in:
1 parent
13e407847f
commit
374428658a
80 files changed
+2517
-1058
No files matched your search
@@ -0,0 +1,17 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
rootCfg = config.selfhosted.pocket-id;
|
||||
in
|
||||
{
|
||||
config = mkIf rootCfg.enable {
|
||||
sops.templates."pocket-id.env".content = ''
|
||||
APP_URL=https://${rootCfg.subdomain}.${config.sops.placeholder."domains/serv"}
|
||||
ENCRYPTION_KEY=${config.sops.placeholder."pocket_id/enc_key"}
|
||||
TRUST_PROXY=true
|
||||
ANALYTICS_DISABLED=true
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
rootCfg = config.selfhosted.pocket-id;
|
||||
cfg = rootCfg.server;
|
||||
hostDataPath = "${common.dataDir}/pocket-id";
|
||||
in
|
||||
{
|
||||
imports = [ ./config.nix ];
|
||||
|
||||
options.selfhosted.pocket-id.server = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
hostHttpPort = mkOption {
|
||||
type = types.port;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf rootCfg.enable {
|
||||
virtualisation.oci-containers.containers.${cfg.name} = {
|
||||
image = "ghcr.io/pocket-id/pocket-id:v2.14.0";
|
||||
ports = [
|
||||
"0.0.0.0:${toString cfg.hostHttpPort}:1411"
|
||||
];
|
||||
user = "${common.user.uid}:${common.group.gid}";
|
||||
environmentFiles = [ config.sops.templates."pocket-id.env".path ];
|
||||
volumes = [
|
||||
"${hostDataPath}/data:/app/data"
|
||||
];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
||||
"--network=${common.network.name}"
|
||||
];
|
||||
};
|
||||
|
||||
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}/letsencrypt
|
||||
chown -R ${common.user.uid}:${common.group.gid} ${hostDataPath}
|
||||
chmod -R 0775 ${hostDataPath}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user