mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
Compare commits
No commits in common. "eb32d5f0d1bbdc98965e9be91543f684efcf9439" and "beeb8b6d907309d3ff10acc6c17a2aa0a2c235ad" have entirely different histories.
eb32d5f0d1
...
beeb8b6d90
8 changed files with 74 additions and 25 deletions
21
flake.lock
generated
21
flake.lock
generated
|
|
@ -688,6 +688,26 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"reboot-bot": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"unstable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1725660144,
|
||||||
|
"narHash": "sha256-k63aCiukMVOjF219V8O9PvXq7WrVnQtiP0vLpBO5iqg=",
|
||||||
|
"owner": "Gerg-L",
|
||||||
|
"repo": "reboot-bot",
|
||||||
|
"rev": "4dabb1fc71cbb222d775db690a13838028012608",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Gerg-L",
|
||||||
|
"repo": "reboot-bot",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"disko": "disko",
|
"disko": "disko",
|
||||||
|
|
@ -699,6 +719,7 @@
|
||||||
"nix-janitor": "nix-janitor",
|
"nix-janitor": "nix-janitor",
|
||||||
"nixos-generators": "nixos-generators",
|
"nixos-generators": "nixos-generators",
|
||||||
"nvim-flake": "nvim-flake",
|
"nvim-flake": "nvim-flake",
|
||||||
|
"reboot-bot": "reboot-bot",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"spicetify-nix": "spicetify-nix",
|
"spicetify-nix": "spicetify-nix",
|
||||||
"stable": "stable",
|
"stable": "stable",
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,12 @@
|
||||||
repo = "fetch-rs";
|
repo = "fetch-rs";
|
||||||
inputs.nixpkgs.follows = "unstable";
|
inputs.nixpkgs.follows = "unstable";
|
||||||
};
|
};
|
||||||
|
reboot-bot = {
|
||||||
|
type = "github";
|
||||||
|
owner = "Gerg-L";
|
||||||
|
repo = "reboot-bot";
|
||||||
|
inputs.nixpkgs.follows = "unstable";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
outputs =
|
outputs =
|
||||||
inputs:
|
inputs:
|
||||||
|
|
|
||||||
22
nixosConfigurations/gerg-desktop/services/reboot-bot.nix
Normal file
22
nixosConfigurations/gerg-desktop/services/reboot-bot.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
reboot-bot,
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
sops.secrets.reboot_token = { };
|
||||||
|
|
||||||
|
systemd.services.reboot_bot = {
|
||||||
|
enable = false;
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = lib.getExe reboot-bot.packages.default;
|
||||||
|
EnvironmentFile = config.sops.secrets.reboot_token.path;
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "30s";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
pluginsDir = lavalinkPlugins;
|
pluginsDir = lavalinkPlugins;
|
||||||
plugins = [
|
plugins = [
|
||||||
{
|
{
|
||||||
dependency = "dev.lavalink.youtube:youtube-plugin:1.13.0";
|
dependency = "dev.lavalink.youtube:youtube-plugin:1.12.0";
|
||||||
enabled = true;
|
enabled = true;
|
||||||
snapshot = false;
|
snapshot = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,5 +142,5 @@
|
||||||
spotify_client_id = p."vocard/spotify_client_id";
|
spotify_client_id = p."vocard/spotify_client_id";
|
||||||
spotify_client_secret = p."vocard/spotify_client_secret";
|
spotify_client_secret = p."vocard/spotify_client_secret";
|
||||||
token = p."vocard/token";
|
token = p."vocard/token";
|
||||||
version = "v2.7.1";
|
version = "v2.6.9";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
}:
|
}:
|
||||||
linkFarm "lavalinkPlugins" [
|
linkFarm "lavalinkPlugins" [
|
||||||
{
|
{
|
||||||
name = "youtube-plugin-1.13.0.jar";
|
name = "youtube-plugin-1.12.0.jar";
|
||||||
path = fetchurl {
|
path = fetchurl {
|
||||||
url = "https://github.com/lavalink-devs/youtube-source/releases/download/1.13.0/youtube-plugin-1.13.0.jar";
|
url = "https://github.com/lavalink-devs/youtube-source/releases/download/1.12.0/youtube-plugin-1.12.0.jar";
|
||||||
hash = "sha256-DL5s+a7HJel9Ouh9tJwFmCN25ThmIJNUhmQ7pn+moCg=";
|
hash = "sha256-M9CDMDGR7fBldPLLG/I5TN21DLNN440nzF1l34MrQK0=";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
makeBinaryWrapper,
|
makeBinaryWrapper,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
version = "2.7.1";
|
version = "2.6.9";
|
||||||
python = python3.withPackages (p: [
|
python = python3.withPackages (p: [
|
||||||
p.discordpy
|
p.discordpy
|
||||||
p.motor
|
p.motor
|
||||||
|
|
@ -26,7 +26,7 @@ stdenv.mkDerivation {
|
||||||
owner = "ChocoMeow";
|
owner = "ChocoMeow";
|
||||||
repo = "Vocard";
|
repo = "Vocard";
|
||||||
tag = "v${version}";
|
tag = "v${version}";
|
||||||
hash = "sha256-0cSR9z6JNB0xdHMyDrDRJQ7xilqGVifCowXuNKipgjQ=";
|
hash = "sha256-21n+6LqXYVXc8ynS62IvWHxK76xxfatN8e99KDPueps=";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
|
|
||||||
diff --git a/function.py b/function.py
|
diff --git a/function.py b/function.py
|
||||||
index e8fcae5..48057b6 100644
|
index 6e09f5e..0c8bfa4 100644
|
||||||
--- a/function.py
|
--- a/function.py
|
||||||
+++ b/function.py
|
+++ b/function.py
|
||||||
@@ -41,7 +41,7 @@ from motor.motor_asyncio import (
|
@@ -18,7 +18,7 @@ from motor.motor_asyncio import (
|
||||||
|
|
||||||
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
|
|
@ -11,7 +12,7 @@ index e8fcae5..48057b6 100644
|
||||||
raise Exception("Settings file not set!")
|
raise Exception("Settings file not set!")
|
||||||
|
|
||||||
#--------------- Cache Var ---------------
|
#--------------- Cache Var ---------------
|
||||||
@@ -85,7 +85,7 @@ class TempCtx():
|
@@ -52,7 +52,7 @@ ALLOWED_MENTIONS = discord.AllowedMentions().none()
|
||||||
#-------------- Vocard Functions --------------
|
#-------------- Vocard Functions --------------
|
||||||
def open_json(path: str) -> dict:
|
def open_json(path: str) -> dict:
|
||||||
try:
|
try:
|
||||||
|
|
@ -20,8 +21,8 @@ index e8fcae5..48057b6 100644
|
||||||
return json.load(json_file)
|
return json.load(json_file)
|
||||||
except:
|
except:
|
||||||
return {}
|
return {}
|
||||||
@@ -97,7 +97,7 @@ def update_json(path: str, new_data: dict) -> None:
|
@@ -64,7 +64,7 @@ def update_json(path: str, new_data: dict) -> None:
|
||||||
else:
|
|
||||||
data.update(new_data)
|
data.update(new_data)
|
||||||
|
|
||||||
- with open(os.path.join(ROOT_DIR, path), "w") as json_file:
|
- with open(os.path.join(ROOT_DIR, path), "w") as json_file:
|
||||||
|
|
@ -29,7 +30,7 @@ index e8fcae5..48057b6 100644
|
||||||
json.dump(data, json_file, indent=4)
|
json.dump(data, json_file, indent=4)
|
||||||
|
|
||||||
def langs_setup() -> None:
|
def langs_setup() -> None:
|
||||||
@@ -107,7 +107,7 @@ def langs_setup() -> None:
|
@@ -74,7 +74,7 @@ def langs_setup() -> None:
|
||||||
|
|
||||||
for language in os.listdir(os.path.join(ROOT_DIR, "local_langs")):
|
for language in os.listdir(os.path.join(ROOT_DIR, "local_langs")):
|
||||||
if language.endswith('.json'):
|
if language.endswith('.json'):
|
||||||
|
|
@ -38,7 +39,7 @@ index e8fcae5..48057b6 100644
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ def get_lang_non_async(guild_id: int, *keys) -> Union[list[str], str]:
|
@@ -130,7 +130,7 @@ def get_lang_non_async(guild_id: int, *keys) -> Union[list[str], str]:
|
||||||
settings = SETTINGS_BUFFER.get(guild_id, {})
|
settings = SETTINGS_BUFFER.get(guild_id, {})
|
||||||
lang = settings.get("lang", "EN")
|
lang = settings.get("lang", "EN")
|
||||||
if lang in LANGS and not LANGS[lang]:
|
if lang in LANGS and not LANGS[lang]:
|
||||||
|
|
@ -47,7 +48,7 @@ index e8fcae5..48057b6 100644
|
||||||
|
|
||||||
if len(keys) == 1:
|
if len(keys) == 1:
|
||||||
return LANGS.get(lang, {}).get(keys[0], "Language pack not found!")
|
return LANGS.get(lang, {}).get(keys[0], "Language pack not found!")
|
||||||
@@ -180,7 +180,7 @@ async def get_lang(guild_id:int, *keys) -> Optional[Union[list[str], str]]:
|
@@ -147,7 +147,7 @@ async def get_lang(guild_id:int, *keys) -> Union[list[str], str]:
|
||||||
settings = await get_settings(guild_id)
|
settings = await get_settings(guild_id)
|
||||||
lang = settings.get("lang", "EN")
|
lang = settings.get("lang", "EN")
|
||||||
if lang in LANGS and not LANGS[lang]:
|
if lang in LANGS and not LANGS[lang]:
|
||||||
|
|
@ -55,28 +56,28 @@ index e8fcae5..48057b6 100644
|
||||||
+ LANGS[lang] = open_json(os.path.join(ROOT_DIR, "langs", f"{lang}.json"))
|
+ LANGS[lang] = open_json(os.path.join(ROOT_DIR, "langs", f"{lang}.json"))
|
||||||
|
|
||||||
if len(keys) == 1:
|
if len(keys) == 1:
|
||||||
return LANGS.get(lang, {}).get(keys[0])
|
return LANGS.get(lang, {}).get(keys[0], "Language pack not found!")
|
||||||
diff --git a/main.py b/main.py
|
diff --git a/main.py b/main.py
|
||||||
index 202db23..f486658 100644
|
index e2c6b9e..98dc34b 100644
|
||||||
--- a/main.py
|
--- a/main.py
|
||||||
+++ b/main.py
|
+++ b/main.py
|
||||||
@@ -138,13 +138,7 @@ class Vocard(commands.Bot):
|
@@ -80,13 +80,7 @@ class Vocard(commands.Bot):
|
||||||
await self.ipc.connect()
|
await self.ipc.connect()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
func.logger.error(f"Cannot connected to dashboard! - Reason: {e}")
|
func.logger.error(f"Cannot connected to dashboard! - Reason: {e}")
|
||||||
-
|
-
|
||||||
- if not func.settings.version or func.settings.version != update.__version__:
|
- if not func.settings.version or func.settings.version != update.__version__:
|
||||||
- await self.tree.sync()
|
|
||||||
- func.update_json("settings.json", new_data={"version": update.__version__})
|
- func.update_json("settings.json", new_data={"version": update.__version__})
|
||||||
- for locale_key, values in func.MISSING_TRANSLATOR.items():
|
-
|
||||||
- func.logger.warning(f'Missing translation for "{", ".join(values)}" in "{locale_key}"')
|
- await self.tree.set_translator(Translator())
|
||||||
|
- await self.tree.sync()
|
||||||
-
|
-
|
||||||
+ await self.tree.sync()
|
+ await self.tree.sync()
|
||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
func.logger.info("------------------")
|
func.logger.info("------------------")
|
||||||
func.logger.info(f"Logging As {self.user}")
|
func.logger.info(f"Logging As {self.user}")
|
||||||
@@ -209,7 +203,7 @@ async def get_prefix(bot: commands.Bot, message: discord.Message) -> str:
|
@@ -144,7 +138,7 @@ async def get_prefix(bot, message: discord.Message):
|
||||||
return prefix
|
return settings.get("prefix", func.settings.bot_prefix)
|
||||||
|
|
||||||
# Loading settings and logger
|
# Loading settings and logger
|
||||||
-func.settings = Settings(func.open_json("settings.json"))
|
-func.settings = Settings(func.open_json("settings.json"))
|
||||||
|
|
@ -84,4 +85,3 @@ index 202db23..f486658 100644
|
||||||
|
|
||||||
LOG_SETTINGS = func.settings.logging
|
LOG_SETTINGS = func.settings.logging
|
||||||
if (LOG_FILE := LOG_SETTINGS.get("file", {})).get("enable", True):
|
if (LOG_FILE := LOG_SETTINGS.get("file", {})).get("enable", True):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue