fix manyfold
This commit is contained in:
39
modules/apps/your-spotify/default.nix
Normal file
39
modules/apps/your-spotify/default.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.your_spotify;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
virtualisation.oci-containers.containers."${cfg.name}-server" = {
|
||||
autoStart = true;
|
||||
image = cfg.imageServer;
|
||||
volumes = [ "${cfg.configPath}:/root/.your-spotify" ];
|
||||
ports = [ "${cfg.portServer}:8080" ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
API_ENDPOINT = "http://10.0.1.18:${cfg.portServer}";
|
||||
CLIENT_ENDPOINT = "http://10.0.1.18:${cfg.portWeb}";
|
||||
SPOTIFY_PUBLIC = "e270589d72a6494680a17d325af8670d";
|
||||
SPOTIFY_SECRET = "423cb7b69fe8486e89eccd01e0c22924";
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers."${cfg.name}-web" = {
|
||||
autoStart = true;
|
||||
image = cfg.imageWeb;
|
||||
ports = [ "${cfg.portWeb}:3000" ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
API_ENDPOINT = "http://10.0.1.18:${cfg.portServer}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
57
modules/apps/your-spotify/options.nix
Normal file
57
modules/apps/your-spotify/options.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.nas-apps.your_spotify = {
|
||||
enable = mkEnableOption "your_spotify docker service";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
portServer = mkOption {
|
||||
type = types.str;
|
||||
default = "7777";
|
||||
};
|
||||
|
||||
portWeb = mkOption {
|
||||
type = types.str;
|
||||
default = "7778";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "your_spotify";
|
||||
};
|
||||
|
||||
imageServer = mkOption {
|
||||
type = types.str;
|
||||
default = "yooooomi/your_spotify_server";
|
||||
};
|
||||
|
||||
imageWeb = mkOption {
|
||||
type = types.str;
|
||||
default = "yooooomi/your_spotify_client";
|
||||
};
|
||||
|
||||
configPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/media/nas/ssd/nix-app-data/your_spotify";
|
||||
};
|
||||
|
||||
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