fix manyfold

This commit is contained in:
mjallen18
2024-09-20 19:17:19 -05:00
parent 1f4010eb89
commit 6553d2b574
13 changed files with 264 additions and 78 deletions

View File

@@ -27,9 +27,6 @@ in
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
# For postgres or mariadb use <scheme>://<username>:<password>@<hostname>:<port>/<db name> where <scheme> is postgresql or mysql2
DATABASE_URL = "sqlite3:/config/manyfold.sqlite3";
# REDIS_URL = "redis://10.0.1.18:6380/0"; # redis://<hostname>:<port>/<db number>
};
environmentFiles = [ config.sops.secrets."jallen-nas/manyfold/secretkeybase".path ];
};

View File

@@ -21,7 +21,7 @@ with lib;
image = mkOption {
type = types.str;
default = "ghcr.io/manyfold3d/manyfold";
default = "ghcr.io/manyfold3d/manyfold-solo";
};
configPath = mkOption {

View File

@@ -0,0 +1,25 @@
{ lib, config, ... }:
with lib;
let
cfg = config.nas-apps.mongodb;
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.port}:27017" ];
volumes = [ "${cfg.configPath}:/data/db mongodb/" ];
# environmentFiles = cfg.environmentFiles;
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
# MONGO_INITDB_ROOT_USERNAME = "";#cfg.databaseUser;
# MONGO_INITDB_ROOT_PASSWORD = "";#cfg.databasePassword; # get from env file
};
};
};
}

View File

@@ -0,0 +1,52 @@
{ lib, ... }:
with lib;
{
options.nas-apps.mongodb = {
enable = mkEnableOption "mongodb docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
port = mkOption {
type = types.str;
default = "27017";
};
name = mkOption {
type = types.str;
default = "mongodb";
};
image = mkOption {
type = types.str;
default = "mongodb/mongodb-community-server";
};
configPath = mkOption {
type = types.str;
default = "/media/nas/ssd/mongodb";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
environmentFiles = mkOption {
type = with types; listOf path;
default = [ ];
};
};
}

View 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}";
};
};
};
}

View 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";
};
};
}

View File

@@ -14,6 +14,7 @@
./apps/manyfold
./apps/mariadb
./apps/mealie
./apps/mongodb
./apps/nextcloud
./apps/ollama
./apps/open-webui
@@ -25,5 +26,6 @@
./apps/tdarr
./apps/vscode
./apps/wireguard
./apps/your-spotify
];
}

View File

@@ -29,25 +29,24 @@ in
services.samba = {
enable = true;
securityType = "user";
openFirewall = true;
extraConfig = ''
create mode = 664
force directory mode = 2770
workgroup = WORKGROUP
server string = jallen-nas
netbios name = jallen-nas
security = user
#use sendfile = yes
#max protocol = smb2
# note: localhost is the ipv6 localhost ::1
hosts allow = ${cfg.hostsAllow} 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
usershare allow guests = yes
'';
shares =
# settings = {
# create-mode = 664;
# force directory mode = 2770
# workgroup = WORKGROUP
# server string = jallen-nas
# netbios name = jallen-nas
# security = user
# #use sendfile = yes
# #max protocol = smb2
# # note: localhost is the ipv6 localhost ::1
# hosts allow = ${cfg.hostsAllow} 127.0.0.1 localhost
# hosts deny = 0.0.0.0/0
# guest account = nobody
# map to guest = bad user
# usershare allow guests = yes
# };
settings =
let
make =
name: share: