mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
vocard: use DynamicUsers
This commit is contained in:
parent
7a2e6450d2
commit
af91541557
7 changed files with 111 additions and 117 deletions
|
|
@ -14,24 +14,17 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
|||
hash = "sha256-G4a9ltPq/L0vcazTQjStTlOOtwrBi37bYUNQHy5CV9Y=";
|
||||
};
|
||||
|
||||
plugin = fetchurl {
|
||||
url = "https://github.com/lavalink-devs/youtube-source/releases/download/1.11.5/youtube-plugin-1.11.5.jar";
|
||||
hash = "sha256-Zz4S5mWcsVFWGmN41L34GqZeCOswt/CAn+1PN1XJtbk=";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||
|
||||
buildCommand = ''
|
||||
install -Dm644 "$src" "$out/lib/Lavalink.jar"
|
||||
install -Dm644 "$plugin" "$out/plugins/youtube-plugin.jar"
|
||||
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${lib.getExe zulu17} $out/bin/lavalink \
|
||||
--add-flags "-jar -Xmx4G $out/lib/Lavalink.jar"
|
||||
mkdir -p "$out/bin"
|
||||
makeWrapper '${lib.getExe zulu17}' "$out/bin/lavalink" \
|
||||
--add-flags "-jar $out/lib/Lavalink.jar"
|
||||
'';
|
||||
|
||||
meta.mainProgram = "lavalink";
|
||||
|
||||
})
|
||||
|
|
|
|||
13
packages/lavalinkPlugins/package.nix
Normal file
13
packages/lavalinkPlugins/package.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
fetchurl,
|
||||
linkFarm,
|
||||
}:
|
||||
linkFarm "lavalinkPlugins" [
|
||||
{
|
||||
name = "youtube-plugin-1.11.5.jar";
|
||||
path = fetchurl {
|
||||
url = "https://github.com/lavalink-devs/youtube-source/releases/download/1.11.5/youtube-plugin-1.11.5.jar";
|
||||
hash = "sha256-Zz4S5mWcsVFWGmN41L34GqZeCOswt/CAn+1PN1XJtbk=";
|
||||
};
|
||||
}
|
||||
]
|
||||
|
|
@ -38,7 +38,7 @@ stdenv.mkDerivation {
|
|||
runHook postBuild
|
||||
'';
|
||||
|
||||
patches = [ ./use_cwd.patch ];
|
||||
patches = [ ./useLoadCredential.patch ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeBinaryWrapper
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
diff --git a/function.py b/function.py
|
||||
index 6e09f5e..f0f6a11 100644
|
||||
index 6e09f5e..0c8bfa4 100644
|
||||
--- a/function.py
|
||||
+++ b/function.py
|
||||
@@ -18,7 +18,7 @@ from motor.motor_asyncio import (
|
||||
|
|
@ -7,7 +8,7 @@ index 6e09f5e..f0f6a11 100644
|
|||
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
-if not os.path.exists(os.path.join(ROOT_DIR, "settings.json")):
|
||||
+if not os.path.exists(os.path.join(os.getcwd(), "settings.json")):
|
||||
+if not os.path.exists(os.path.join(os.getenv("CREDENTIALS_DIRECTORY"), "settings.json")):
|
||||
raise Exception("Settings file not set!")
|
||||
|
||||
#--------------- Cache Var ---------------
|
||||
|
|
@ -57,19 +58,21 @@ index 6e09f5e..f0f6a11 100644
|
|||
if len(keys) == 1:
|
||||
return LANGS.get(lang, {}).get(keys[0], "Language pack not found!")
|
||||
diff --git a/main.py b/main.py
|
||||
index e2c6b9e..4ff7de6 100644
|
||||
index e2c6b9e..98dc34b 100644
|
||||
--- a/main.py
|
||||
+++ b/main.py
|
||||
@@ -81,12 +81,6 @@ class Vocard(commands.Bot):
|
||||
@@ -80,13 +80,7 @@ class Vocard(commands.Bot):
|
||||
await self.ipc.connect()
|
||||
except Exception as e:
|
||||
func.logger.error(f"Cannot connected to dashboard! - Reason: {e}")
|
||||
|
||||
-
|
||||
- if not func.settings.version or func.settings.version != update.__version__:
|
||||
- func.update_json("settings.json", new_data={"version": update.__version__})
|
||||
-
|
||||
- await self.tree.set_translator(Translator())
|
||||
- await self.tree.sync()
|
||||
-
|
||||
+ await self.tree.sync()
|
||||
async def on_ready(self):
|
||||
func.logger.info("------------------")
|
||||
func.logger.info(f"Logging As {self.user}")
|
||||
|
|
@ -78,7 +81,7 @@ index e2c6b9e..4ff7de6 100644
|
|||
|
||||
# Loading settings and logger
|
||||
-func.settings = Settings(func.open_json("settings.json"))
|
||||
+func.settings = Settings(func.open_json(os.path.join(os.getcwd(),"settings.json")))
|
||||
+func.settings = Settings(func.open_json(os.path.join(os.getenv("CREDENTIALS_DIRECTORY"),"settings.json")))
|
||||
|
||||
LOG_SETTINGS = func.settings.logging
|
||||
if (LOG_FILE := LOG_SETTINGS.get("file", {})).get("enable", True):
|
||||
Loading…
Add table
Add a link
Reference in a new issue