Compare commits

...

10 Commits

9 changed files with 176 additions and 19 deletions

8
flake.lock generated
View File

@ -2,16 +2,16 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1746557022, "lastModified": 1753345091,
"narHash": "sha256-QkNoyEf6TbaTW5UZYX0OkwIJ/ZMeKSSoOMnSDPQuol0=", "narHash": "sha256-CdX2Rtvp5I8HGu9swBmYuq+ILwRxpXdJwlpg8jvN4tU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1d3aeb5a193b9ff13f63f4d9cc169fb88129f860", "rev": "3ff0e34b1383648053bba8ed03f201d3466f90c9",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-24.11", "ref": "nixos-25.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@ -1,7 +1,7 @@
{ {
description = "Nix flake for the activity logging script"; description = "Nix flake for the activity logging script";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
# sudoku-solver.url = "path:./src/sudoku-hs"; # sudoku-solver.url = "path:./src/sudoku-hs";
}; };
outputs = outputs =
@ -50,6 +50,7 @@
pano = pkgs.callPackage ./pkgs/pano/default.nix { }; pano = pkgs.callPackage ./pkgs/pano/default.nix { };
mealie = pkgs.callPackage ./pkgs/mealie/package.nix { }; mealie = pkgs.callPackage ./pkgs/mealie/package.nix { };
vdhcoapp = pkgs.callPackage ./pkgs/vdhcoapp/default.nix { }; vdhcoapp = pkgs.callPackage ./pkgs/vdhcoapp/default.nix { };
resilio = pkgs.callPackage ./pkgs/resilio/package.nix { };
# sudoku-solver = inputs.sudoku-solver.packages.${system}.default; # sudoku-solver = inputs.sudoku-solver.packages.${system}.default;
} }
// generatePackages { // generatePackages {

61
pkgs/resilio/package.nix Normal file
View File

@ -0,0 +1,61 @@
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
libxcrypt-legacy,
}:
stdenv.mkDerivation rec {
pname = "resilio-sync";
version = "2.8.1.1390";
src =
{
x86_64-linux = fetchurl {
url = "https://download-cdn.resilio.com/${version}/linux/x64/0/resilio-sync_x64.tar.gz";
sha256 = "sha256-XrfE2frDxOS32MzO7gpJEsMd0WY+b7TS0h/H94M7Py4=";
};
i686-linux = fetchurl {
url = "https://download-cdn.resilio.com/${version}/linux/i386/0/resilio-sync_i386.tar.gz";
sha256 = "sha256-tWwb9DHLlXeyimzyo/yxVKqlkP3jlAxT2Yzs6h2bIgs=";
};
aarch64-linux = fetchurl {
url = "https://download-cdn.resilio.com/${version}/linux/arm64/0/resilio-sync_arm64.tar.gz";
sha256 = "sha256-b859DqxTfnBMMeiwXlGKTQ+Mpmr2Rpg24l/GNkxSWbA=";
};
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
dontStrip = true; # Don't strip, otherwise patching the rpaths breaks
sourceRoot = ".";
nativeBuildInputs = [
autoPatchelfHook
];
buildInputs = [
stdenv.cc.libc
libxcrypt-legacy
];
installPhase = ''
install -D rslsync "$out/bin/rslsync"
'';
meta = with lib; {
description = "Automatically sync files via secure, distributed technology";
homepage = "https://www.resilio.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfreeRedistributable;
platforms = platforms.linux;
maintainers = with maintainers; [
domenkozar
thoughtpolice
cwoac
];
mainProgram = "rslsync";
};
}

View File

@ -7,16 +7,20 @@
python3.pkgs.buildPythonApplication rec { python3.pkgs.buildPythonApplication rec {
pname = "qbit-manage"; pname = "qbit-manage";
version = "4.1.14"; version = "4.3.0";
pyproject = true; pyproject = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "StuffAnThings"; owner = "StuffAnThings";
repo = "qbit_manage"; repo = "qbit_manage";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-JTQZlJ2d0oOpT8lIf9mgQ/onTs5jiWfvzFx0XBjbCQo="; hash = "sha256-Wj1s11PwHfH4hDGEn0jW/REO2gI7+AGyb2B/QKUhlyk=";
}; };
postPatch = ''
rm LICENSE
'';
build-system = [ build-system = [
python3.pkgs.setuptools python3.pkgs.setuptools
python3.pkgs.wheel python3.pkgs.wheel
@ -27,12 +31,27 @@ python3.pkgs.buildPythonApplication rec {
gitpython gitpython
humanize humanize
pytimeparse2 pytimeparse2
qbittorrent-api bencode-py
requests requests
retrying retrying
ruamel-yaml ruamel-yaml
schedule schedule
(callPackage ./bencodepy.nix { }) (callPackage ./qbittorrent-api.nix {
inherit lib;
inherit (python3.pkgs)
buildPythonPackage
fetchPypi
# build-system
setuptools
setuptools-scm
# dependencies
packaging
requests
urllib3
;
})
]; ];
meta = { meta = {

View File

@ -0,0 +1,25 @@
diff --git a/modules/logs.py b/modules/logs.py
index 1234567..abcdef0 100644
--- a/modules/logs.py
+++ b/modules/logs.py
@@ class MyLogger:
def __init__(
self, logger_name, log_file, log_level, default_dir, screen_width, separating_character, ignore_ghost, log_size, log_count
):
- self.log_dir = os.path.join(default_dir, LOG_DIR)
- self.main_log = log_file if os.path.exists(os.path.dirname(log_file)) else os.path.join(self.log_dir, log_file)
+ self.log_dir = None
+ self.main_log = log_file
self.main_handler = None
self.save_errors = False
self.saved_errors = []
self.config_handlers = {}
self.secrets = set()
self.spacing = 0
self.log_size = log_size
self.log_count = log_count
- os.makedirs(self.log_dir, exist_ok=True)
self._logger = logging.getLogger(self.logger_name)
logging.DRYRUN = DRYRUN
logging.addLevelName(DRYRUN, "DRYRUN")

View File

@ -0,0 +1,50 @@
{
lib,
buildPythonPackage,
fetchPypi,
# build-system
setuptools,
setuptools-scm,
# dependencies
packaging,
requests,
urllib3,
}:
buildPythonPackage rec {
pname = "qbittorrent-api";
version = "2025.5.0";
pyproject = true;
src = fetchPypi {
pname = "qbittorrent_api";
inherit version;
hash = "sha256-NKD5weGufhbeUOlGUXUsjZejz1TCo+GgXGqDdzmaDjA=";
};
build-system = [
setuptools
setuptools-scm
];
dependencies = [
packaging
requests
urllib3
];
# Tests require internet access
doCheck = false;
pythonImportsCheck = [ "qbittorrentapi" ];
meta = {
description = "Python client implementation for qBittorrent's Web API";
homepage = "https://github.com/rmartin16/qbittorrent-api";
changelog = "https://github.com/rmartin16/qbittorrent-api/blob/v${version}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ savyajha ];
};
}

11
src/not flake/deprecated-rewrite/discord_chatlogs Normal file → Executable file
View File

@ -1,14 +1,15 @@
#!/usr/bin/env fish #! /usr/bin/env nix-shell
#! nix-shell -i fish -p fish discordchatexporter-cli
read -gP "Insert Token: " token read -gP "Insert Token: " token
read -gP "Insert an after date: " dateInput read -gP "Insert an after date: " dateInput
set afterDate (date "+%F %H:%M:%S" --date="$dateInput") set afterDate (date "+%F %H:%M:%S" --date="$dateInput")
set beforeDate (date "+%F %H:%M:%S") set beforeDate (date "+%F %H:%M:%S")
set guildIDs 828901086722785281 659186066724749312 \ # set guildIDs 828901086722785281 659186066724749312 \
618655243554521089 111912780377985024 # 618655243554521089 111912780377985024
set guildNames 'The fattest pussy club' CreativeCringeCorner \ # set guildNames 'The fattest pussy club' CreativeCringeCorner \
'Bound Art With Lore and Less Minors' 'Webcomic Land' # 'Bound Art With Lore and Less Minors' 'Webcomic Land'
set dmIDs 808310797004308500 539621978504560640 810121293818363934 816078347972116491 set dmIDs 808310797004308500 539621978504560640 810121293818363934 816078347972116491
set dmNames Hurricane DeftBeck Tomayto Weenie set dmNames Hurricane DeftBeck Tomayto Weenie
set baseDir $HOME/Temp/Discord set baseDir $HOME/Temp/Discord

View File

@ -15,7 +15,7 @@ download)
--add-entry="Link:" \ --add-entry="Link:" \
--entry-text "$(xclip -o -sel clip)") --entry-text "$(xclip -o -sel clip)")
if [ -n "$ENTRY" ]; then if [ -n "$ENTRY" ]; then
cmd="ssh server \"download -u jawz" cmd="download -u jawz"
if ! zenity --question --text "Use archive database?" \ if ! zenity --question --text "Use archive database?" \
--ok-label="Yes" --cancel-label="Cancel"; then --ok-label="Yes" --cancel-label="Cancel"; then
@ -26,7 +26,7 @@ download)
cmd+=" -s" cmd+=" -s"
fi fi
cmd+=" -i \"$ENTRY\" \"" cmd+=" -i \"$ENTRY\" "
ghostty -e "$cmd" ghostty -e "$cmd"
else else
zenity --error --width=250 \ zenity --error --width=250 \

View File

@ -10,7 +10,7 @@ fi
root=/srv/pool/scrapping root=/srv/pool/scrapping
cd $root || exit cd $root || exit
set -- Aqp Ghekre set -- Aqp ElasticWind
for user in "$@"; do for user in "$@"; do
originDir=$root/$user originDir=$root/$user
destDir=/srv/pool/nextcloud/$user/files/Requested destDir=/srv/pool/nextcloud/$user/files/Requested
@ -44,12 +44,12 @@ for user in "$@"; do
find ./ -mindepth 1 -type d -empty -delete find ./ -mindepth 1 -type d -empty -delete
chown 987:988 -R "$destDir" chown "$(id -u nextcloud)":"$(id -g nextcloud)" -R "$destDir"
find "$destDir" -type d -exec chmod -R 755 {} \; find "$destDir" -type d -exec chmod -R 755 {} \;
find "$destDir" -type f -exec chmod -R 644 {} \; find "$destDir" -type f -exec chmod -R 644 {} \;
if [ -d "$destDirDup" ]; then if [ -d "$destDirDup" ]; then
chown 987:988 -R "$destDirDup" chown "$(id -u nextcloud)":"$(id -g nextcloud)" -R "$destDir"
find "$destDirDup" -type d -exec chmod -R 755 {} \; find "$destDirDup" -type d -exec chmod -R 755 {} \;
find "$destDirDup" -type f -exec chmod -R 644 {} \; find "$destDirDup" -type f -exec chmod -R 644 {} \;
fi fi