Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions hosts/glyph/secrets/audiomuse-env.age
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 rSr+rA Xv5Z5uJ2taK1fC1adStPVMyhJDeynSwoe89k4Fo/Enw
zrKo7M7UJ3hdaKCMp7B8fImRA1VIVyv2zrBmqW2psS0
-> ssh-ed25519 3EWhnQ 8BWG7aLna2EboJ63F2iISv/yRNWksn3bXiekgHFCSj4
/VZUGmL+20q3+/HHgq8wUdgP6uhOvPoDhJkaJMiLuqQ
--- v69QvzRzgmi08DMSTg+f87/GqVrtSeppJiH7RptDVoE
ñôÏVÕ&ÀYäÆ3ö¡KÐz] õÁÖ5ÖÒ!Øa¥
67 changes: 67 additions & 0 deletions hosts/glyph/services/audiomuse.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{config, ...}: let
dataDir = "/var/lib/audiomuse";
in {
age.secrets.audiomuse-env.file = ./../secrets/audiomuse-env.age;

systemd.tmpfiles.rules = [
"d ${dataDir} 0755 root root - -"
"d ${dataDir}/temp-flask 0755 root root - -"
"d ${dataDir}/plugins-flask 0755 root root - -"
"d ${dataDir}/temp-worker 0755 root root - -"
"d ${dataDir}/plugins-worker 0755 root root - -"
];

virtualisation.oci-containers.containers = {
audiomuse-flask = {
image = "ghcr.io/neptunehub/audiomuse-ai:latest";
environmentFiles = [config.age.secrets.audiomuse-env.path];
environment = {
SERVICE_TYPE = "flask";
TZ = config.time.timeZone;
POSTGRES_USER = "audiomuse";
POSTGRES_DB = "audiomuse";
POSTGRES_HOST = "127.0.0.1";
POSTGRES_PORT = "5432";
TEMP_DIR = "/app/temp_audio";
};
volumes = [
"${dataDir}/temp-flask:/app/temp_audio"
"${dataDir}/plugins-flask:/app/plugin/installed"
];
extraOptions = ["--network=host"];
};

audiomuse-worker = {
image = "ghcr.io/neptunehub/audiomuse-ai:latest";
environmentFiles = [config.age.secrets.audiomuse-env.path];
environment = {
SERVICE_TYPE = "worker";
TZ = config.time.timeZone;
POSTGRES_USER = "audiomuse";
POSTGRES_DB = "audiomuse";
POSTGRES_HOST = "127.0.0.1";
POSTGRES_PORT = "5432";
TEMP_DIR = "/app/temp_audio";
NUMBA_CACHE_DIR = "/app/temp_audio/.numba_cache";
};
volumes = [
"${dataDir}/temp-worker:/app/temp_audio"
"${dataDir}/plugins-worker:/app/plugin/installed"
];
extraOptions = ["--network=host"];
};
};

systemd.services = {
"podman-audiomuse-flask" = {
after = ["postgresql.service"];
requires = ["postgresql.service"];
};
"podman-audiomuse-worker" = {
after = ["postgresql.service"];
requires = ["postgresql.service"];
};
};

networking.firewall.allowedTCPPorts = [8000];
}
8 changes: 6 additions & 2 deletions hosts/glyph/services/db.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
port = 5432;
max_connections = 150;
};
ensureDatabases = ["atticd" "grafana" "open-webui" "pocketid"];
ensureDatabases = ["atticd" "audiomuse" "grafana" "open-webui" "pocketid"];
ensureUsers = [
{
name = "mu";
Expand All @@ -22,6 +22,10 @@
name = "atticd";
ensureDBOwnership = true;
}
{
name = "audiomuse";
ensureDBOwnership = true;
}
{
name = "grafana";
ensureDBOwnership = true;
Expand All @@ -39,6 +43,6 @@

services.postgresqlBackup = {
enable = true;
databases = ["atticd" "grafana" "open-webui" "pocketid" "windmill"];
databases = ["atticd" "audiomuse" "grafana" "open-webui" "pocketid" "windmill"];
};
}
1 change: 1 addition & 0 deletions hosts/glyph/services/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
imports = [
./alloy.nix
./attic.nix
./audiomuse.nix
./db.nix
./avahi.nix
./dns.nix
Expand Down
3 changes: 2 additions & 1 deletion hosts/glyph/services/navidrome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ in {
environmentFile = config.age.secrets.navidrome-env.path;
plugins = [
pkgs.navidromePlugins.apple-music
pkgs.navidromePlugins.audiomuseai
nd-lyrics
];
settings = {
Expand All @@ -41,7 +42,7 @@ in {
Scanner.Schedule = "@every 1h";
RecentlyAddedByModTime = true;
Prometheus.Enabled = true;
Agents = "apple-music,lastfm,deezer";
Agents = "apple-music,lastfm,deezer,audiomuseai";
LyricsPriority = ".ttml,.yaml,.yml,.elrc,.lrc,.srt,.txt,embedded,nd-lyrics";
};
};
Expand Down
2 changes: 1 addition & 1 deletion hosts/glyph/services/open-terminal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
virtualisation.oci-containers.backend = "podman";
virtualisation.oci-containers.containers.open-terminal = {
image = "ghcr.io/open-webui/open-terminal:latest";
ports = ["8000:8000"];
ports = ["8001:8000"];
volumes = ["open-terminal:/home/user"];
environmentFiles = [config.age.secrets.open-terminal-env.path];
environment = {
Expand Down
1 change: 1 addition & 0 deletions lib/secrets/glyph.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ in {
"hosts/glyph/secrets/user-password.age".publicKeys = keys;
"hosts/glyph/secrets/obsidian-auth-token.age".publicKeys = keys;
"hosts/glyph/secrets/navidrome-env.age".publicKeys = keys;
"hosts/glyph/secrets/audiomuse-env.age".publicKeys = keys;
}
Loading