Compare commits
15 Commits
4f5049f3ab
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e91264f0f | ||
|
|
093ccf90cb | ||
|
|
07daae7770 | ||
|
|
df61132974 | ||
|
|
cd60c3ad69 | ||
|
|
d1f011ba1f | ||
|
|
a8e7517e9a | ||
|
|
b827ffab8f | ||
|
|
bf9c1796d4 | ||
|
|
5c13b806a0 | ||
|
|
6aea101721 | ||
| 9ab256ded7 | |||
| e9fc085de1 | |||
| 38959dc37b | |||
| 64a81ca78d |
75
flake.lock
generated
75
flake.lock
generated
@@ -1,24 +1,89 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1753345091,
|
||||
"narHash": "sha256-CdX2Rtvp5I8HGu9swBmYuq+ILwRxpXdJwlpg8jvN4tU=",
|
||||
"lastModified": 1762653957,
|
||||
"narHash": "sha256-3em63zYO+s0NxxKwPXyzV80fXfwZOg7/LjYF5ndZltc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3ff0e34b1383648053bba8ed03f201d3466f90c9",
|
||||
"rev": "c148fa0cf61fc3bb7b011f2d4f8d789964ea7dd0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-25.05",
|
||||
"ref": "master",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1743576891,
|
||||
"narHash": "sha256-vXiKURtntURybE6FMNFAVpRPr8+e8KoLPrYs9TGuAKc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "44a69ed688786e98a101f02b712c313f1ade37ab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-24.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"sudoku-solver": "sudoku-solver"
|
||||
}
|
||||
},
|
||||
"sudoku-solver": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"path": "./src/sudoku-hs",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"path": "./src/sudoku-hs",
|
||||
"type": "path"
|
||||
},
|
||||
"parent": []
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
31
flake.nix
31
flake.nix
@@ -1,8 +1,8 @@
|
||||
{
|
||||
description = "Nix flake for the activity logging script";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
# sudoku-solver.url = "path:./src/sudoku-hs";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/master";
|
||||
sudoku-solver.url = "path:./src/sudoku-hs";
|
||||
};
|
||||
outputs =
|
||||
{ nixpkgs, ... }@inputs:
|
||||
@@ -11,6 +11,7 @@
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = [ inputs.self.overlays.default ];
|
||||
};
|
||||
generatePackages =
|
||||
args:
|
||||
@@ -28,30 +29,30 @@
|
||||
|> builtins.listToAttrs;
|
||||
in
|
||||
{
|
||||
overlays.default = final: prev: {
|
||||
scrapy = prev.scrapy.overrideAttrs (old: rec {
|
||||
version = "2.11.2";
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "scrapy";
|
||||
repo = "scrapy";
|
||||
tag = version;
|
||||
hash = "sha256-EaO1kQ3VSTwEW+r0kSKycOxHNTPwwCVjch1ZBrTU0qQ=";
|
||||
overlays.default = _final: prev: {
|
||||
python3Packages = prev.python3Packages.override {
|
||||
overrides = pyself: pysuper: {
|
||||
webcomix = prev.python3Packages.callPackage ./pkgs_pr/webcomix.nix { };
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
packages.x86_64-linux =
|
||||
let
|
||||
scriptBin = path: name: pkgs.writeScriptBin name (builtins.readFile path);
|
||||
pkgsBin = path: name: pkgs.callPackage path { };
|
||||
pkgsBin = path: _name:
|
||||
let
|
||||
content = builtins.readFile path;
|
||||
in
|
||||
if builtins.match ".*(buildPythonPackage|buildPythonApplication).*" content != null
|
||||
then pkgs.python3Packages.callPackage path { }
|
||||
else pkgs.callPackage path { };
|
||||
in
|
||||
{
|
||||
citra = pkgs.callPackage ./pkgs/citra/default.nix { branch = "nightly"; };
|
||||
torzu = pkgs.callPackage ./pkgs/torzu/package.nix { };
|
||||
pano = pkgs.callPackage ./pkgs/pano/default.nix { };
|
||||
mealie = pkgs.callPackage ./pkgs/mealie/package.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 {
|
||||
dir = "pkgs";
|
||||
|
||||
@@ -45,10 +45,10 @@ stdenv.mkDerivation {
|
||||
glslang
|
||||
pkg-config
|
||||
python3
|
||||
] ++ lib.optionals enableQt [ wrapQtAppsHook ];
|
||||
]
|
||||
++ lib.optionals enableQt [ wrapQtAppsHook ];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
buildInputs = [
|
||||
boost
|
||||
libusb1
|
||||
]
|
||||
@@ -63,8 +63,7 @@ stdenv.mkDerivation {
|
||||
++ lib.optional useDiscordRichPresence rapidjson
|
||||
++ lib.optional enableFdk fdk_aac;
|
||||
|
||||
cmakeFlags =
|
||||
[
|
||||
cmakeFlags = [
|
||||
"-DUSE_SYSTEM_BOOST=ON"
|
||||
"-DCITRA_WARNINGS_AS_ERRORS=OFF"
|
||||
"-DCITRA_USE_BUNDLED_FFMPEG=OFF"
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
{
|
||||
python3Packages,
|
||||
buildPythonApplication,
|
||||
setuptools,
|
||||
pyyaml,
|
||||
types-pyyaml,
|
||||
yt-dlp,
|
||||
gallery-dl,
|
||||
ffmpeg,
|
||||
callPackage,
|
||||
webcomix,
|
||||
...
|
||||
}:
|
||||
let
|
||||
pname = "download";
|
||||
version = "2.6";
|
||||
in
|
||||
python3Packages.buildPythonApplication {
|
||||
buildPythonApplication {
|
||||
inherit pname version;
|
||||
|
||||
src = builtins.path {
|
||||
@@ -19,19 +23,14 @@ python3Packages.buildPythonApplication {
|
||||
|
||||
pyproject = true;
|
||||
|
||||
build-system = [ python3Packages.setuptools ];
|
||||
build-system = [ setuptools ];
|
||||
|
||||
dependencies =
|
||||
[
|
||||
dependencies = [
|
||||
ffmpeg
|
||||
gallery-dl
|
||||
# (callPackage ../pkgs_pr/webcomix.nix { })
|
||||
]
|
||||
++ builtins.attrValues {
|
||||
inherit (python3Packages)
|
||||
pyyaml
|
||||
types-pyyaml
|
||||
yt-dlp
|
||||
;
|
||||
};
|
||||
webcomix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -95,7 +95,8 @@ let
|
||||
cmakeFlags = [
|
||||
"-GNinja"
|
||||
"-DLauncher_QT_VERSION_MAJOR=${lib.versions.major qt6.qtbase.version}"
|
||||
] ++ lib.optionals (msaClientID != null) [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ];
|
||||
]
|
||||
++ lib.optionals (msaClientID != null) [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ];
|
||||
|
||||
postPatch = ''
|
||||
# hardcode jdk paths
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
{
|
||||
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";
|
||||
};
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
gum,
|
||||
xclip,
|
||||
ghostty,
|
||||
rmlint,
|
||||
callPackage,
|
||||
...
|
||||
}:
|
||||
@@ -19,7 +20,7 @@ writeShellApplication {
|
||||
gum
|
||||
xclip
|
||||
ghostty
|
||||
(callPackage ../pkgs_pr/rmlint.nix { })
|
||||
rmlint
|
||||
];
|
||||
|
||||
text = builtins.readFile ../src/packaged_scripts/run.sh;
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
lz4,
|
||||
python3,
|
||||
unzip,
|
||||
nix-update-script,
|
||||
nlohmann_json,
|
||||
nv-codec-headers-12,
|
||||
pkg-config,
|
||||
@@ -30,7 +29,6 @@
|
||||
vulkan-headers,
|
||||
vulkan-loader,
|
||||
yasm,
|
||||
simpleini,
|
||||
zlib,
|
||||
vulkan-memory-allocator,
|
||||
zstd,
|
||||
|
||||
@@ -1,24 +1,28 @@
|
||||
{ python3Packages, sqlite, ... }:
|
||||
{
|
||||
buildPythonApplication,
|
||||
setuptools,
|
||||
beautifulsoup4,
|
||||
requests,
|
||||
matplotlib,
|
||||
sqlite,
|
||||
...
|
||||
}:
|
||||
let
|
||||
pname = "tuh-activity-logger";
|
||||
version = "1.0";
|
||||
in
|
||||
python3Packages.buildPythonApplication {
|
||||
buildPythonApplication {
|
||||
inherit pname version;
|
||||
src = builtins.path {
|
||||
path = ../src/tuhmayto/.;
|
||||
name = "${pname}-${version}";
|
||||
};
|
||||
build-system = [ python3Packages.setuptools ];
|
||||
dependencies =
|
||||
[
|
||||
pyproject = true;
|
||||
build-system = [ setuptools ];
|
||||
dependencies = [
|
||||
sqlite
|
||||
]
|
||||
++ builtins.attrValues {
|
||||
inherit (python3Packages)
|
||||
beautifulsoup4
|
||||
requests
|
||||
matplotlib
|
||||
;
|
||||
};
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
setuptools,
|
||||
wheel,
|
||||
gevent,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonPackage rec {
|
||||
buildPythonPackage rec {
|
||||
pname = "gevent-eventemitter";
|
||||
version = "2.1";
|
||||
pyproject = true;
|
||||
@@ -16,12 +19,12 @@ python3Packages.buildPythonPackage rec {
|
||||
hash = "sha256-aW4OsQi3N5yAMdbTd8rxbb2qYMfFJBR4WQFIXvxpiMw=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [
|
||||
build-system = [
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
dependencies = [
|
||||
gevent
|
||||
];
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
python3Packages,
|
||||
buildPythonPackage,
|
||||
setuptools,
|
||||
wheel,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonPackage rec {
|
||||
buildPythonPackage rec {
|
||||
pname = "inputs";
|
||||
version = "0.5";
|
||||
pyproject = true;
|
||||
@@ -17,8 +19,8 @@ python3Packages.buildPythonPackage rec {
|
||||
};
|
||||
|
||||
build-system = [
|
||||
python3Packages.setuptools
|
||||
python3Packages.wheel
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
appimageTools,
|
||||
runCommand,
|
||||
curl,
|
||||
gnugrep,
|
||||
cacert,
|
||||
fetchurl,
|
||||
copyDesktopItems,
|
||||
makeDesktopItem,
|
||||
}:
|
||||
|
||||
appimageTools.wrapType1 rec {
|
||||
pname = "pureref";
|
||||
version = "2.0.3";
|
||||
|
||||
src =
|
||||
runCommand "PureRef-${version}_x64.Appimage"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
curl
|
||||
gnugrep
|
||||
cacert
|
||||
];
|
||||
outputHash = "sha256-0iR1cP2sZvWWqKwRAwq6L/bmIBSYHKrlI8u8V2hANfM=";
|
||||
}
|
||||
''
|
||||
key="$(curl -A 'nixpkgs/Please contact maintainer if there is an issue' "https://www.pureref.com/download.php" --silent | grep '%3D%3D' | cut -d '"' -f2)"
|
||||
curl -L "https://www.pureref.com/files/build.php?build=LINUX64.Appimage&version=${version}&downloadKey=$key" --output $out
|
||||
'';
|
||||
|
||||
icon = fetchurl {
|
||||
url = "https://raw.githubusercontent.com/nextcloud/talk-desktop/refs/tags/v1.0.0/img/icons/icon.png";
|
||||
hash = "sha256-DteSSuxIs0ukIJrvUO/3Mrh5F2GG5UAVvGRZUuZonkg=";
|
||||
};
|
||||
nativeBuildInputs = [
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
type = "Application";
|
||||
name = "pureref";
|
||||
desktopName = "PureRef";
|
||||
# comment = finalAttrs.meta.description;
|
||||
# exec = finalAttrs.meta.mainProgram;
|
||||
icon = "pureref";
|
||||
categories = [
|
||||
"Graphics"
|
||||
"2DGraphics"
|
||||
"RasterGraphics"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Reference Image Viewer";
|
||||
homepage = "https://www.pureref.com";
|
||||
license = licenses.unfree;
|
||||
maintainers = with maintainers; [
|
||||
elnudev
|
||||
husjon
|
||||
];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
||||
};
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
cairo,
|
||||
elfutils,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
glib,
|
||||
gobject-introspection,
|
||||
gtksourceview3,
|
||||
json-glib,
|
||||
makeWrapper,
|
||||
pango,
|
||||
pkg-config,
|
||||
polkit,
|
||||
python3,
|
||||
scons,
|
||||
sphinx,
|
||||
util-linux,
|
||||
wrapGAppsHook3,
|
||||
withGui ? false,
|
||||
}:
|
||||
|
||||
assert withGui -> !stdenv.hostPlatform.isDarwin;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "rmlint";
|
||||
version = "2.10.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sahib";
|
||||
repo = "rmlint";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-pOo1YfeqHUU6xyBRFbcj2lX1MHJ+a5Hi31BMC1nYZGo=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# pass through NIX_* environment variables to scons.
|
||||
./rmlint/scons-nix-env.patch
|
||||
# fix #664
|
||||
(fetchpatch {
|
||||
url = "https://github.com/sahib/rmlint/commit/f0ca57ec907f7199e3670038d60b4702d1e1d8e2.patch";
|
||||
hash = "sha256-715X+R2BcQIaUV76hoO+EXPfNheOfw4OIHsqSoruIUI=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs =
|
||||
[
|
||||
pkg-config
|
||||
sphinx
|
||||
scons
|
||||
]
|
||||
++ lib.optionals withGui [
|
||||
makeWrapper
|
||||
wrapGAppsHook3
|
||||
gobject-introspection
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
glib
|
||||
json-glib
|
||||
util-linux
|
||||
]
|
||||
++ lib.optionals withGui [
|
||||
cairo
|
||||
gtksourceview3
|
||||
pango
|
||||
polkit
|
||||
python3
|
||||
python3.pkgs.pygobject3
|
||||
]
|
||||
++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [
|
||||
elfutils
|
||||
];
|
||||
|
||||
prePatch = ''
|
||||
# remove sources of nondeterminism
|
||||
substituteInPlace lib/cmdline.c \
|
||||
--replace "__DATE__" "\"Jan 1 1970\"" \
|
||||
--replace "__TIME__" "\"00:00:00\""
|
||||
substituteInPlace docs/SConscript \
|
||||
--replace "gzip -c " "gzip -cn "
|
||||
'';
|
||||
|
||||
# Otherwise tries to access /usr.
|
||||
prefixKey = "--prefix=";
|
||||
|
||||
sconsFlags = lib.optionals (!withGui) [ "--without-gui" ];
|
||||
|
||||
# in GUI mode, this shells out to itself, and tries to import python modules
|
||||
postInstall = lib.optionalString withGui ''
|
||||
gappsWrapperArgs+=(--prefix PATH : "$out/bin")
|
||||
gappsWrapperArgs+=(--prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${python3.pkgs.pygobject3}):$(toPythonPath ${python3.pkgs.pycairo})")
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Extremely fast tool to remove duplicates and other lint from your filesystem";
|
||||
homepage = "https://rmlint.readthedocs.org";
|
||||
platforms = platforms.unix;
|
||||
license = licenses.gpl3;
|
||||
maintainers = with maintainers; [
|
||||
aaschmid
|
||||
koral
|
||||
];
|
||||
mainProgram = "rmlint";
|
||||
};
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
scons does not use os environment by default:
|
||||
https://scons.org/doc/2.1.0/HTML/scons-user/x1750.html
|
||||
|
||||
nixpkgs' cc-wrapper on the other hand relies on various NIX_* variables
|
||||
to be passed through like NIX_CFLAGS_COMPILE_BEFORE.
|
||||
--- a/SConstruct
|
||||
+++ b/SConstruct
|
||||
@@ -559,10 +559,7 @@ options = dict(
|
||||
SHLINKCOMSTR=link_shared_library_message,
|
||||
LINKCOMSTR=link_program_message,
|
||||
PREFIX=GetOption('prefix'),
|
||||
- ENV = dict([ (key, os.environ[key])
|
||||
- for key in os.environ
|
||||
- if key in ['PATH', 'TERM', 'HOME', 'PKG_CONFIG_PATH']
|
||||
- ])
|
||||
+ ENV = os.environ,
|
||||
)
|
||||
|
||||
if ARGUMENTS.get('VERBOSE') == "1":
|
||||
114
pkgs_pr/talk.nix
114
pkgs_pr/talk.nix
@@ -1,114 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
fetchzip,
|
||||
autoPatchelfHook,
|
||||
copyDesktopItems,
|
||||
makeDesktopItem,
|
||||
nss,
|
||||
cairo,
|
||||
xorg,
|
||||
libxkbcommon,
|
||||
alsa-lib,
|
||||
at-spi2-core,
|
||||
mesa,
|
||||
pango,
|
||||
libdrm,
|
||||
vivaldi-ffmpeg-codecs,
|
||||
gtk3,
|
||||
libGL,
|
||||
libglvnd,
|
||||
systemd,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "nextcloud-talk-desktop";
|
||||
version = "1.0.0";
|
||||
|
||||
# Building from source would require building also building Server and Talk components
|
||||
# See https://github.com/nextcloud/talk-desktop?tab=readme-ov-file#%EF%B8%8F-prerequisites
|
||||
src = fetchzip {
|
||||
url = "https://github.com/nextcloud-releases/talk-desktop/releases/download/v${finalAttrs.version}/Nextcloud.Talk-linux-x64.zip";
|
||||
hash = "sha256-XQa4Fa9eEaFlYrWa00S9aMWKJOPPFGSo4NAlRqE23jM=";
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
icon = fetchurl {
|
||||
url = "https://raw.githubusercontent.com/nextcloud/talk-desktop/refs/tags/v1.0.0/img/icons/icon.png";
|
||||
hash = "sha256-DteSSuxIs0ukIJrvUO/3Mrh5F2GG5UAVvGRZUuZonkg=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
nss
|
||||
cairo
|
||||
alsa-lib
|
||||
at-spi2-core
|
||||
pango
|
||||
libdrm
|
||||
libxkbcommon
|
||||
gtk3
|
||||
vivaldi-ffmpeg-codecs
|
||||
mesa
|
||||
libGL
|
||||
libglvnd
|
||||
]
|
||||
++ (with xorg; [
|
||||
libX11
|
||||
libXcomposite
|
||||
libXdamage
|
||||
libXrandr
|
||||
libXfixes
|
||||
libXcursor
|
||||
]);
|
||||
|
||||
# Required to launch the application and proceed past the zygote_linux fork() process
|
||||
# Fixes `Zygote could not fork`
|
||||
runtimeDependencies = [ systemd ];
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
type = "Application";
|
||||
name = "nextcloud-talk-desktop";
|
||||
desktopName = "Nextcloud Talk";
|
||||
comment = finalAttrs.meta.description;
|
||||
exec = finalAttrs.meta.mainProgram;
|
||||
icon = "nextcloud-talk-desktop";
|
||||
categories = [ "Chat" ];
|
||||
})
|
||||
];
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/opt
|
||||
|
||||
cp -r $src/* $out/opt/
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
# Link the application in $out/bin away from contents of `preInstall`
|
||||
ln -s "$out/opt/Nextcloud Talk-linux-x64/Nextcloud Talk" $out/bin/nextcloud-talk-desktop
|
||||
mkdir -p $out/share/icons/hicolor/512x512/apps
|
||||
cp $icon $out/share/icons/hicolor/512x512/apps/nextcloud-talk-desktop.png
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Nextcloud Talk Desktop Client";
|
||||
homepage = "https://github.com/nextcloud/talk-desktop";
|
||||
changelog = "https://github.com/nextcloud/talk-desktop/blob/${finalAttrs.version}/CHANGELOG.md";
|
||||
license = licenses.agpl3Only;
|
||||
maintainers = with maintainers; [ kashw2 ];
|
||||
mainProgram = "nextcloud-talk-desktop";
|
||||
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
||||
};
|
||||
})
|
||||
@@ -1,19 +1,27 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
python3Packages,
|
||||
buildPythonApplication,
|
||||
poetry-core,
|
||||
click,
|
||||
tqdm,
|
||||
scrapy,
|
||||
scrapy-splash,
|
||||
scrapy-fake-useragent,
|
||||
pytest-rerunfailures,
|
||||
docker,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
buildPythonApplication rec {
|
||||
pname = "webcomix";
|
||||
version = "3.11.1";
|
||||
version = "3.12.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "J-CPelletier";
|
||||
repo = "webcomix";
|
||||
rev = version;
|
||||
hash = "sha256-vs7IE1IQ6/2uOYqLUskW4vGFdoz8z/ZBYQPteTcdOR0=";
|
||||
hash = "sha256-Vsn6Ju4+SG8iOCxnqixnpi9apr8Nc4/mFjpjipPud6g=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
@@ -24,15 +32,23 @@ python3Packages.buildPythonApplication rec {
|
||||
'';
|
||||
|
||||
build-system = [
|
||||
python3Packages.poetry-core
|
||||
poetry-core
|
||||
];
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
dependencies = [
|
||||
click
|
||||
tqdm
|
||||
scrapy
|
||||
scrapy-splash
|
||||
scrapy-fake-useragent
|
||||
(scrapy-splash.overridePythonAttrs (oldAttrs: {
|
||||
doCheck = false;
|
||||
nativeCheckInputs = [ ];
|
||||
}))
|
||||
(scrapy-fake-useragent.overridePythonAttrs (oldAttrs: {
|
||||
doCheck = false;
|
||||
nativeCheckInputs = [ ];
|
||||
checkPhase = "";
|
||||
preCheck = "";
|
||||
}))
|
||||
pytest-rerunfailures
|
||||
docker
|
||||
];
|
||||
@@ -43,6 +59,9 @@ python3Packages.buildPythonApplication rec {
|
||||
|
||||
doCheck = false;
|
||||
|
||||
# Skip runtime dependency check due to version mismatches with nixpkgs
|
||||
dontCheckRuntimeDeps = true;
|
||||
|
||||
meta = {
|
||||
description = "Webcomic downloader";
|
||||
homepage = "https://github.com/J-CPelletier/webcomix";
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
stdenv,
|
||||
lib,
|
||||
python3,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
meson,
|
||||
appstream-glib,
|
||||
@@ -16,7 +15,7 @@
|
||||
gtk4,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finaAttrs: rec {
|
||||
stdenv.mkDerivation (_finaAttrs: rec {
|
||||
pname = "aviator";
|
||||
version = "0.6.0";
|
||||
pyproject = true;
|
||||
@@ -35,7 +34,7 @@ stdenv.mkDerivation (finaAttrs: rec {
|
||||
pkg-config
|
||||
desktop-file-utils
|
||||
ninja
|
||||
python3Packages.pygobject3
|
||||
python3.pkgs.pygobject3
|
||||
gobject-introspection
|
||||
];
|
||||
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitLab,
|
||||
makeWrapper,
|
||||
python3,
|
||||
gtk4,
|
||||
libadwaita,
|
||||
wrapGAppsHook4,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -15,6 +20,38 @@ stdenv.mkDerivation rec {
|
||||
hash = "sha256-oPGC0D7sh+H25qg2ttRtIMjI+HjZImRieWmYw+I6sQE=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
wrapGAppsHook4
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
gtk4
|
||||
libadwaita
|
||||
(python3.withPackages (ps: with ps; [
|
||||
pygobject3
|
||||
pycairo
|
||||
]))
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin $out/share/hexcolordle-gtk $out/share/applications $out/share/metainfo
|
||||
cp -r * $out/share/hexcolordle-gtk/
|
||||
|
||||
# Install desktop file and metainfo
|
||||
cp net.krafting.HexColordle.desktop $out/share/applications/
|
||||
cp net.krafting.HexColordle.metainfo.xml $out/share/metainfo/
|
||||
|
||||
# Create wrapper for the main Python file
|
||||
makeWrapper ${python3.withPackages (ps: with ps; [pygobject3 pycairo])}/bin/python3 $out/bin/hexcolordle-gtk \
|
||||
--add-flags "$out/share/hexcolordle-gtk/HexColordle.py" \
|
||||
--prefix PYTHONPATH : "$out/share/hexcolordle-gtk"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "A game where you need to find a color by guessing its hex code";
|
||||
homepage = "https://gitlab.com/Krafting/hexcolordle-gtk";
|
||||
|
||||
@@ -15,17 +15,18 @@
|
||||
gtk4,
|
||||
libadwaita,
|
||||
wrapGAppsHook4,
|
||||
makeWrapper,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dosage";
|
||||
version = "1.7.5";
|
||||
version = "1.9.11";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "diegopvlk";
|
||||
repo = "Dosage";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-dpmv9GbAgLAZJCifHssC0HQEBXHjrO0mquQd24pNMM0=";
|
||||
hash = "sha256-TS9niQd3jlALQrFu6H2SucZwwQp0k2BRHqZCYfbz+CI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -38,18 +39,30 @@ stdenv.mkDerivation rec {
|
||||
glib
|
||||
appstream-glib
|
||||
appstream
|
||||
wrapGAppsHook4
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
gjs
|
||||
gtk4
|
||||
libadwaita
|
||||
wrapGAppsHook4
|
||||
glib
|
||||
];
|
||||
|
||||
# Ensure GResource files are properly accessible
|
||||
postInstall = ''
|
||||
# The GResource files should be automatically handled by wrapGAppsHook4
|
||||
# but let's make sure the GResource path is correct
|
||||
wrapProgram $out/bin/io.github.diegopvlk.Dosage \
|
||||
--prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Medication tracker for Linux";
|
||||
homepage = "https://github.com/diegopvlk/Dosage";
|
||||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [ ];
|
||||
mainProgram = "dosage";
|
||||
mainProgram = "io.github.diegopvlk.Dosage";
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
meson,
|
||||
ninja,
|
||||
gettext,
|
||||
pkg-config,
|
||||
desktop-file-utils,
|
||||
appstream-glib,
|
||||
glib,
|
||||
blueprint-compiler,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -23,8 +28,19 @@ stdenv.mkDerivation rec {
|
||||
meson
|
||||
ninja
|
||||
gettext
|
||||
pkg-config
|
||||
desktop-file-utils
|
||||
appstream-glib
|
||||
glib
|
||||
blueprint-compiler
|
||||
];
|
||||
|
||||
# Override the post-install script to avoid sandbox issues
|
||||
postInstall = ''
|
||||
# The original postinstall.py tries to run glib-compile-schemas which fails in sandbox
|
||||
echo "Skipping glib-compile-schemas and other post-install steps"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Girens is a Plex GTK client for playing movies, TV shows and music from your Plex library";
|
||||
homepage = "https://gitlab.gnome.org/tijder/girens";
|
||||
|
||||
@@ -17,24 +17,26 @@
|
||||
pango,
|
||||
darwin,
|
||||
alsa-lib,
|
||||
pulseaudio,
|
||||
pipewire,
|
||||
desktop-file-utils,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "exercise-timer";
|
||||
version = "1.8.1";
|
||||
version = "1.8.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mfep";
|
||||
repo = "exercise-timer";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-6MBSUYFZ8nMZX7acam8T0uJWb9E2/L9vnKzJq14p4BY=";
|
||||
hash = "sha256-YZYAhG8xpXM1m1LrXgwxo3JF74QjOmbnuSbo4SYPBmg=";
|
||||
};
|
||||
|
||||
cargoDeps = rustPlatform.fetchCargoTarball {
|
||||
cargoDeps = rustPlatform.fetchCargoVendor {
|
||||
inherit src;
|
||||
name = "${pname}-${version}";
|
||||
hash = "sha256-mXHw87IUMq1qXQSTavI/ReKUyB0rNMXYld8vND38C30=";
|
||||
hash = "sha256-JObzeiQHEGIDjOung3o8dpaXVcOoJS2v1hyrcS1fqcI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -49,8 +51,7 @@ stdenv.mkDerivation rec {
|
||||
desktop-file-utils
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
buildInputs = [
|
||||
cairo
|
||||
gdk-pixbuf
|
||||
glib
|
||||
|
||||
38
pkgs_wip/inputs.nix
Normal file
38
pkgs_wip/inputs.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
buildPythonPackage,
|
||||
setuptools,
|
||||
wheel,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "inputs";
|
||||
version = "0.5";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "zeth";
|
||||
repo = "inputs";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-tU1R6lhSMZj3Y6XdrT/Yfbte/BdLDvo6TzvLbnr+1vo=";
|
||||
};
|
||||
|
||||
build-system = [
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"inputs"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Cross-platform Python support for keyboards, mice and gamepads";
|
||||
homepage = "https://github.com/zeth/inputs";
|
||||
changelog = "https://github.com/zeth/inputs/blob/${src.rev}/CHANGELOG.rst";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ CaptainJawZ ];
|
||||
mainProgram = "inputs";
|
||||
};
|
||||
}
|
||||
@@ -1,43 +1,49 @@
|
||||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
buildPythonApplication,
|
||||
fetchFromGitHub,
|
||||
callPackage,
|
||||
setuptools,
|
||||
pyside6,
|
||||
pyxdg,
|
||||
pyyaml,
|
||||
requests,
|
||||
vdf,
|
||||
zstandard,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
buildPythonApplication rec {
|
||||
pname = "proton-up-qt";
|
||||
version = "2.10.2";
|
||||
version = "2.14.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "DavidoTek";
|
||||
repo = "ProtonUp-Qt";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-hf0ZLvn5mv0BlUgMvDwpdsa9ye3Bz47n0aSz+jgBrXg=";
|
||||
hash = "sha256-UiU2yLajMW5FnRSNS8TCg9Cqs8AkuXA+4FJTS2kfi6I=";
|
||||
};
|
||||
|
||||
pythonRemoveDeps = [
|
||||
"pyside6-essentials"
|
||||
];
|
||||
|
||||
# Skip runtime dependency check for missing packages
|
||||
dontCheckRuntimeDeps = true;
|
||||
|
||||
build-system = [
|
||||
python3Packages.setuptools
|
||||
setuptools
|
||||
];
|
||||
|
||||
dependencies =
|
||||
with python3Packages;
|
||||
[
|
||||
dependencies = [
|
||||
pyside6
|
||||
pyxdg
|
||||
pyyaml
|
||||
requests
|
||||
vdf
|
||||
zstandard
|
||||
]
|
||||
++ [
|
||||
(callPackage ./inputs.nix { })
|
||||
(callPackage ./steam.nix { })
|
||||
(callPackage ./steam-python.nix { })
|
||||
];
|
||||
|
||||
meta = {
|
||||
@@ -45,6 +51,6 @@ python3Packages.buildPythonApplication rec {
|
||||
homepage = "https://github.com/DavidoTek/ProtonUp-Qt";
|
||||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [ CaptainJawZ ];
|
||||
mainProgram = "proton-up-qt";
|
||||
mainProgram = "protonup-qt";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,20 +1,34 @@
|
||||
{
|
||||
lib,
|
||||
python3,
|
||||
buildPythonApplication,
|
||||
fetchFromGitHub,
|
||||
callPackage,
|
||||
setuptools,
|
||||
wheel,
|
||||
argon2-cffi,
|
||||
bencode-py,
|
||||
croniter,
|
||||
fastapi,
|
||||
gitpython,
|
||||
humanize,
|
||||
pytimeparse2,
|
||||
qbittorrent-api,
|
||||
requests,
|
||||
retrying,
|
||||
ruamel-yaml,
|
||||
slowapi,
|
||||
uvicorn,
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
buildPythonApplication rec {
|
||||
pname = "qbit-manage";
|
||||
version = "4.3.0";
|
||||
version = "4.6.3";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "StuffAnThings";
|
||||
repo = "qbit_manage";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-Wj1s11PwHfH4hDGEn0jW/REO2gI7+AGyb2B/QKUhlyk=";
|
||||
hash = "sha256-cTxM3nHQQto7lpoNjShYcCbJCSYiwS9bKqw0DWAjw6A=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
@@ -22,38 +36,29 @@ python3.pkgs.buildPythonApplication rec {
|
||||
'';
|
||||
|
||||
build-system = [
|
||||
python3.pkgs.setuptools
|
||||
python3.pkgs.wheel
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
dependencies = with python3.pkgs; [
|
||||
dependencies = [
|
||||
argon2-cffi
|
||||
bencode-py
|
||||
croniter
|
||||
fastapi
|
||||
gitpython
|
||||
humanize
|
||||
pytimeparse2
|
||||
bencode-py
|
||||
qbittorrent-api
|
||||
requests
|
||||
retrying
|
||||
ruamel-yaml
|
||||
schedule
|
||||
(callPackage ./qbittorrent-api.nix {
|
||||
inherit lib;
|
||||
inherit (python3.pkgs)
|
||||
buildPythonPackage
|
||||
fetchPypi
|
||||
|
||||
# build-system
|
||||
setuptools
|
||||
setuptools-scm
|
||||
|
||||
# dependencies
|
||||
packaging
|
||||
requests
|
||||
urllib3
|
||||
;
|
||||
})
|
||||
slowapi
|
||||
uvicorn
|
||||
];
|
||||
|
||||
# Skip runtime dependency check due to version mismatches with nixpkgs
|
||||
dontCheckRuntimeDeps = true;
|
||||
|
||||
meta = {
|
||||
description = "This tool will help manage tedious tasks in qBittorrent and automate them. Tag, categorize, remove Orphaned data, remove unregistered torrents and much much more";
|
||||
homepage = "https://github.com/StuffAnThings/qbit_manage";
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "qbittorrent-api";
|
||||
version = "2025.5.0";
|
||||
version = "2025.7.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchPypi {
|
||||
pname = "qbittorrent_api";
|
||||
inherit version;
|
||||
hash = "sha256-NKD5weGufhbeUOlGUXUsjZejz1TCo+GgXGqDdzmaDjA=";
|
||||
hash = "sha256-9GLygXVZzKpMbNwSaUoxU++s1Q+jKFpCVAGrMKvA3nY=";
|
||||
};
|
||||
|
||||
build-system = [
|
||||
|
||||
43
pkgs_wip/stashapi.nix
Normal file
43
pkgs_wip/stashapi.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
hatch-vcs,
|
||||
hatchling,
|
||||
requests,
|
||||
typing-extensions,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "stashapi";
|
||||
version = "0.1.1";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "stg-annon";
|
||||
repo = "stashapi";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-zwDkT8Y6iftq/OxrBzIBvyJ3po4Pfna4xyRKu5KtJco=";
|
||||
};
|
||||
|
||||
build-system = [
|
||||
hatch-vcs
|
||||
hatchling
|
||||
];
|
||||
|
||||
dependencies = [
|
||||
requests
|
||||
typing-extensions
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"stashapi"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Api wrapper";
|
||||
homepage = "https://github.com/stg-annon/stashapi";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ ];
|
||||
};
|
||||
}
|
||||
47
pkgs_wip/stashapp-tools.nix
Normal file
47
pkgs_wip/stashapp-tools.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
setuptools,
|
||||
wheel,
|
||||
requests,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "stashapp-tools";
|
||||
version = "0.2.59";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "stg-annon";
|
||||
repo = "stashapp-tools";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-1IkFQrdfEAVldr6QHcPkYuKUutc4uvRPTpHyz0gp768=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
build-system = [
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py \
|
||||
--replace 'version="main"' 'version="${version}"'
|
||||
'';
|
||||
|
||||
dependencies = [
|
||||
requests
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"stashapi"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Tools to interface with stashapps API";
|
||||
homepage = "https://github.com/stg-annon/stashapp-tools";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ ];
|
||||
};
|
||||
}
|
||||
59
pkgs_wip/steam-python.nix
Normal file
59
pkgs_wip/steam-python.nix
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
callPackage,
|
||||
setuptools,
|
||||
wheel,
|
||||
six,
|
||||
pycryptodomex,
|
||||
requests,
|
||||
urllib3,
|
||||
vdf,
|
||||
gevent,
|
||||
protobuf,
|
||||
cachetools,
|
||||
cryptography,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "steam-python";
|
||||
version = "1.4.4";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ValvePython";
|
||||
repo = "steam";
|
||||
rev = version;
|
||||
hash = "sha256-OY04GsX3KMPvpsQl8sUurzFyJu+JKpES8B0iD6Z5uyw=";
|
||||
};
|
||||
|
||||
build-system = [
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
dependencies = [
|
||||
six
|
||||
pycryptodomex
|
||||
requests
|
||||
urllib3
|
||||
vdf
|
||||
gevent
|
||||
protobuf
|
||||
cachetools
|
||||
cryptography
|
||||
(callPackage ../pkgs_pr/gevent-eventemitter.nix { })
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"steam"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Python package for interacting with Steam";
|
||||
homepage = "https://github.com/ValvePython/steam";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ CaptainJawZ ];
|
||||
};
|
||||
}
|
||||
@@ -1,12 +1,24 @@
|
||||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
callPackage,
|
||||
setuptools,
|
||||
wheel,
|
||||
six,
|
||||
pycryptodomex,
|
||||
requests,
|
||||
urllib3,
|
||||
vdf,
|
||||
gevent,
|
||||
protobuf,
|
||||
cachetools,
|
||||
cryptography,
|
||||
gevent-eventemitter,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonPackage rec {
|
||||
pname = "steam";
|
||||
buildPythonPackage rec {
|
||||
pname = "steam-python";
|
||||
version = "1.4.4";
|
||||
pyproject = true;
|
||||
|
||||
@@ -17,14 +29,12 @@ python3Packages.buildPythonPackage rec {
|
||||
hash = "sha256-OY04GsX3KMPvpsQl8sUurzFyJu+JKpES8B0iD6Z5uyw=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [
|
||||
build-system = [
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
dependencies =
|
||||
with python3Packages;
|
||||
[
|
||||
dependencies = [
|
||||
six
|
||||
pycryptodomex
|
||||
requests
|
||||
@@ -34,8 +44,8 @@ python3Packages.buildPythonPackage rec {
|
||||
protobuf
|
||||
cachetools
|
||||
cryptography
|
||||
]
|
||||
++ [ (callPackage ./gevent-eventemitter.nix { }) ];
|
||||
gevent-eventemitter
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"steam"
|
||||
@@ -1,10 +1,20 @@
|
||||
{
|
||||
lib,
|
||||
python3,
|
||||
buildPythonApplication,
|
||||
fetchFromGitHub,
|
||||
setuptools,
|
||||
pyxdg,
|
||||
torf,
|
||||
coverage,
|
||||
flake8,
|
||||
isort,
|
||||
pytest,
|
||||
pytest-cov,
|
||||
ruff,
|
||||
tox,
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
buildPythonApplication rec {
|
||||
pname = "torf-cli";
|
||||
version = "5.2.1";
|
||||
pyproject = true;
|
||||
@@ -17,15 +27,15 @@ python3.pkgs.buildPythonApplication rec {
|
||||
};
|
||||
|
||||
build-system = [
|
||||
python3.pkgs.setuptools
|
||||
setuptools
|
||||
];
|
||||
|
||||
dependencies = with python3.pkgs; [
|
||||
dependencies = [
|
||||
pyxdg
|
||||
torf
|
||||
];
|
||||
|
||||
optional-dependencies = with python3.pkgs; {
|
||||
optional-dependencies = {
|
||||
dev = [
|
||||
coverage
|
||||
flake8
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
{
|
||||
lib,
|
||||
python3,
|
||||
buildPythonApplication,
|
||||
fetchFromGitHub,
|
||||
setuptools,
|
||||
flatbencode,
|
||||
coverage,
|
||||
flake8,
|
||||
isort,
|
||||
mypy,
|
||||
pytest,
|
||||
pytest-cov,
|
||||
pytest-httpserver,
|
||||
pytest-mock,
|
||||
pytest-xdist,
|
||||
ruff,
|
||||
tox,
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
buildPythonApplication rec {
|
||||
pname = "torf";
|
||||
version = "4.3.0";
|
||||
pyproject = true;
|
||||
@@ -17,14 +30,14 @@ python3.pkgs.buildPythonApplication rec {
|
||||
};
|
||||
|
||||
build-system = [
|
||||
python3.pkgs.setuptools
|
||||
setuptools
|
||||
];
|
||||
|
||||
dependencies = with python3.pkgs; [
|
||||
dependencies = [
|
||||
flatbencode
|
||||
];
|
||||
|
||||
optional-dependencies = with python3.pkgs; {
|
||||
optional-dependencies = {
|
||||
dev = [
|
||||
coverage
|
||||
flake8
|
||||
|
||||
@@ -34,6 +34,18 @@ class Gallery:
|
||||
command += f" --download-archive {database}" if self.archive else ""
|
||||
command += self.opt_args if self.opt_args else ""
|
||||
|
||||
# Add authentication options from environment variables
|
||||
command += ' -o "extractor.pixiv.refresh-token=${GALLERY_DL_PIXIV_REFRESH_TOKEN}"'
|
||||
command += ' -o "extractor.bluesky.password=${GALLERY_DL_BLUESKY_PASSWORD}"'
|
||||
command += ' -o "extractor.deviantart.refresh-token=${GALLERY_DL_DEVIANTART_REFRESH_TOKEN}"'
|
||||
command += ' -o "extractor.flickr.access-token=${GALLERY_DL_FLICKR_ACCESS_TOKEN}"'
|
||||
command += ' -o "extractor.flickr.access-token-secret=${GALLERY_DL_FLICKR_ACCESS_TOKEN_SECRET}"'
|
||||
command += ' -o "extractor.reddit.refresh-token=${GALLERY_DL_REDDIT_REFRESH_TOKEN}"'
|
||||
command += ' -o "extractor.tumblr.access-token=${GALLERY_DL_TUMBLR_ACCESS_TOKEN}"'
|
||||
command += ' -o "extractor.tumblr.access-token-secret=${GALLERY_DL_TUMBLR_ACCESS_TOKEN_SECRET}"'
|
||||
command += ' -o "extractor.tumblr.api-key=${GALLERY_DL_TUMBLR_API_KEY}"'
|
||||
command += ' -o "extractor.tumblr.api-secret=${GALLERY_DL_TUMBLR_API_SECRET}"'
|
||||
|
||||
if self.link and not self.list:
|
||||
command += f" {quote(self.link)}"
|
||||
if self.list and not self.link:
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
}:
|
||||
|
||||
pkgs.mkShell {
|
||||
packages =
|
||||
[
|
||||
packages = [
|
||||
(pkgs.python3.withPackages (
|
||||
ps:
|
||||
builtins.attrValues {
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
let pkgs = import <nixpkgs> { };
|
||||
in pkgs.haskellPackages.developPackage {
|
||||
let
|
||||
pkgs = import <nixpkgs> { };
|
||||
in
|
||||
pkgs.haskellPackages.developPackage {
|
||||
root = ./.;
|
||||
modifier = drv:
|
||||
pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages; [
|
||||
modifier =
|
||||
drv:
|
||||
pkgs.haskell.lib.addBuildTools drv (
|
||||
with pkgs.haskellPackages;
|
||||
[
|
||||
cabal-install
|
||||
ghcid
|
||||
haskell-language-server
|
||||
fourmolu
|
||||
regex
|
||||
]);
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
}:
|
||||
|
||||
with pkgs;
|
||||
|
||||
mkShell {
|
||||
packages = [
|
||||
geckodriver
|
||||
(python3.withPackages (ps:
|
||||
with ps; [
|
||||
(python3.withPackages (
|
||||
ps: with ps; [
|
||||
tweepy
|
||||
requests
|
||||
beautifulsoup4
|
||||
selenium
|
||||
webdriver-manager
|
||||
]))
|
||||
]
|
||||
))
|
||||
];
|
||||
buildInputs = [ ];
|
||||
}
|
||||
|
||||
302
src/scripts/gaytorss.sh
Executable file
302
src/scripts/gaytorss.sh
Executable file
@@ -0,0 +1,302 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl wget lftp xmlstarlet coreutils gnugrep gnused openssh sshpass
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
## CONFIG (edit if you must)
|
||||
RSS_URL='https://www.gaytor.rent/rss.php?num=10&feed=dl&cat=69,62,29,46,30,43,19,17,59,44,50,9,7,48,5,67,66,34,68,27,32,63,12,33,53,57,35,36,58,37,54,38,39,64,56,40,61,60,45,47,70,1,41,42,51,65,28&passkey=c8babd3026b740b6bb80c1811cc3fdbb'
|
||||
REMOTE_HOST='67.lw.itsby.design'
|
||||
REMOTE_PATH='/home/crouton6368z/watch'
|
||||
TMPDIR="$(mktemp -d /tmp/rss-torrents.XXXXXX)"
|
||||
LOGFILE="${TMPDIR}/rss-to-ftps.log"
|
||||
KEEP_LOCAL=false # set to true if you want to keep local .torrent files
|
||||
HISTORY_FILE="${HOME}/.rss-to-ftps.history"
|
||||
touch "$HISTORY_FILE"
|
||||
|
||||
cleanup() {
|
||||
rc=$?
|
||||
if [[ $rc -ne 0 ]]; then
|
||||
echo "ERROR: script failed (exit $rc). See $LOGFILE" >&2
|
||||
fi
|
||||
if [[ "${KEEP_LOCAL}" = false ]]; then
|
||||
rm -rf "$TMPDIR"
|
||||
else
|
||||
echo "Local files kept in $TMPDIR"
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "Working in $TMPDIR" | tee "$LOGFILE"
|
||||
|
||||
# FTP credentials
|
||||
COOKIE_FILE="${HOME}/.librewolf/cookies.txt"
|
||||
|
||||
# Check if cookie file exists
|
||||
if [ ! -f "$COOKIE_FILE" ]; then
|
||||
echo "WARNING: Cookie file not found at $COOKIE_FILE" | tee -a "$LOGFILE"
|
||||
echo "This may cause authentication issues. Make sure you are logged into gaytor.rent in LibreWolf." | tee -a "$LOGFILE"
|
||||
else
|
||||
echo "Using cookies from: $COOKIE_FILE" | tee -a "$LOGFILE"
|
||||
|
||||
# Check if we need to convert cookies to curl format
|
||||
if [ -f "$COOKIE_FILE" ]; then
|
||||
# Check if it's in Netscape format (which curl can use directly)
|
||||
if head -1 "$COOKIE_FILE" | grep -q "# Netscape HTTP Cookie File"; then
|
||||
echo "Using Netscape format cookies directly" | tee -a "$LOGFILE"
|
||||
else
|
||||
echo "Converting cookies to curl format..." | tee -a "$LOGFILE"
|
||||
# Convert to curl format if needed
|
||||
CURL_COOKIES="${TMPDIR}/curl_cookies.txt"
|
||||
grep -v "^#" "$COOKIE_FILE" | grep -v "^$" | while IFS=$'\t' read -r domain flag path secure expiration name value; do
|
||||
if [ -n "$domain" ] && [ -n "$name" ] && [ -n "$value" ]; then
|
||||
echo "$domain\t$flag\t$path\t$secure\t$expiration\t$name\t$value" >> "$CURL_COOKIES"
|
||||
fi
|
||||
done
|
||||
COOKIE_FILE="$CURL_COOKIES"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
FTP_USER='crouton6368z'
|
||||
FTP_PASS='PGR7HoxZK8F4Npuh'
|
||||
|
||||
cd "$TMPDIR"
|
||||
|
||||
# Fetch RSS
|
||||
RSS_XML="${TMPDIR}/feed.xml"
|
||||
echo "Downloading RSS feed..." | tee -a "$LOGFILE"
|
||||
|
||||
# Validate passkey by checking if RSS feed contains valid content
|
||||
if grep -q "You don't have access\|Access denied\|Authentication failed\|Invalid passkey" "$RSS_XML" 2>/dev/null; then
|
||||
echo "ERROR: RSS feed indicates authentication failure. Your passkey may be invalid or expired." | tee -a "$LOGFILE"
|
||||
echo "Please check your passkey and try again." | tee -a "$LOGFILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if RSS feed has any items
|
||||
if ! grep -q "<item>" "$RSS_XML" 2>/dev/null; then
|
||||
echo "WARNING: RSS feed appears to be empty or invalid. This might indicate an authentication issue." | tee -a "$LOGFILE"
|
||||
fi
|
||||
curl -fsS --max-time 60 -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36" -b "$COOKIE_FILE" -o "$RSS_XML" "$RSS_URL" || {
|
||||
echo "Failed to download RSS feed" | tee -a "$LOGFILE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Try robust XML extraction of enclosure URLs
|
||||
echo "Extracting .torrent URLs from feed..." | tee -a "$LOGFILE"
|
||||
mapfile -t URLs < <(
|
||||
xmlstarlet sel -N x="http://purl.org/rss/1.0/" -t \
|
||||
-m "//enclosure" -v "@url" -n "$RSS_XML" 2>/dev/null || true
|
||||
)
|
||||
|
||||
# Also try common RSS nodes: <link>, <guid>, media:content/@url
|
||||
mapfile -t EXTRA < <(
|
||||
xmlstarlet sel -t -m "//*[(local-name()='link' or local-name()='guid' or local-name()='content' )]" \
|
||||
-v "." -n "$RSS_XML" 2>/dev/null || true
|
||||
)
|
||||
|
||||
# Aggregate and filter for .torrent urls (absolute and containing .torrent)
|
||||
allurls=()
|
||||
for u in "${URLs[@]}"; do
|
||||
[[ -z "$u" ]] && continue
|
||||
allurls+=("$u")
|
||||
done
|
||||
for u in "${EXTRA[@]}"; do
|
||||
[[ "$u" =~ \.torrent ]] || continue
|
||||
allurls+=("$u")
|
||||
done
|
||||
|
||||
# Fallback: a conservative grep for http(s) links ending with .torrent
|
||||
if [ "${#allurls[@]}" -eq 0 ]; then
|
||||
echo "XML extraction returned nothing; falling back to regex grep." | tee -a "$LOGFILE"
|
||||
mapfile -t GREPURLS < <(grep -oE 'https?://[^"'\''<> ]+\.torrent[^"'\''<> ]*' "$RSS_XML" | sed 's/&/\&/g' | sort -u)
|
||||
for u in "${GREPURLS[@]}"; do
|
||||
allurls+=("$u")
|
||||
done
|
||||
fi
|
||||
|
||||
# Deduplicate and sanitize
|
||||
declare -A seen
|
||||
final_urls=()
|
||||
for u in "${allurls[@]}"; do
|
||||
# trim whitespace and decode HTML entities
|
||||
u="$(echo "$u" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e 's/&/\&/g' -e 's/</</g' -e 's/>/>/g' -e 's/"/"/g' -e "s/'/'/g")"
|
||||
[[ -z "$u" ]] && continue
|
||||
if [[ -z "${seen[$u]:-}" ]]; then
|
||||
seen[$u]=1
|
||||
final_urls+=("$u")
|
||||
fi
|
||||
done
|
||||
|
||||
# Filter out URLs we've already downloaded
|
||||
urls_to_fetch=()
|
||||
for url in "${final_urls[@]}"; do
|
||||
if ! grep -Fxq "$url" "$HISTORY_FILE"; then
|
||||
urls_to_fetch+=("$url")
|
||||
else
|
||||
echo "Skipping already-seen URL: $url" | tee -a "$LOGFILE"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${#final_urls[@]}" -eq 0 ]; then
|
||||
echo "No .torrent URLs found in feed. Exiting." | tee -a "$LOGFILE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${#urls_to_fetch[@]}" -eq 0 ]; then
|
||||
echo "All ${#final_urls[@]} URLs already downloaded. Nothing to do." | tee -a "$LOGFILE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Found ${#final_urls[@]} candidate URLs (${#urls_to_fetch[@]} new). Downloading..." | tee -a "$LOGFILE"
|
||||
|
||||
# Download each .torrent (skip if already downloaded)
|
||||
for url in "${urls_to_fetch[@]}"; do
|
||||
# guess filename
|
||||
fname="$(basename "${url%%\?*}")"
|
||||
# fallback if basename weird
|
||||
if [[ ! "$fname" =~ \.torrent$ ]]; then
|
||||
fname="$(echo "$url" | md5sum | awk '{print $1}').torrent"
|
||||
fi
|
||||
|
||||
if [[ -f "$fname" ]]; then
|
||||
echo "Skipping existing $fname" | tee -a "$LOGFILE"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "DEBUG: Attempting to download from URL: $url" | tee -a "$LOGFILE"
|
||||
echo "DEBUG: URL length: ${#url}" | tee -a "$LOGFILE"
|
||||
echo "DEBUG: URL contains .torrent: $([[ "$url" =~ .torrent ]] && echo "YES" || echo "NO")" | tee -a "$LOGFILE"
|
||||
|
||||
# Test the URL first with a HEAD request
|
||||
echo "DEBUG: Testing URL with HEAD request..." | tee -a "$LOGFILE"
|
||||
if curl -I --max-time 30 -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36" -b "$COOKIE_FILE" "$url" 2>&1 | tee -a "$LOGFILE"; then
|
||||
echo "DEBUG: HEAD request successful" | tee -a "$LOGFILE"
|
||||
else
|
||||
echo "DEBUG: HEAD request failed" | tee -a "$LOGFILE"
|
||||
fi
|
||||
echo "Downloading: $url -> $fname" | tee -a "$LOGFILE"
|
||||
# try curl then wget as fallback
|
||||
if ! curl -fsSL --max-time 120 -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36" -b "$COOKIE_FILE" -o "$fname" "$url"; then
|
||||
echo "curl failed for $url, trying wget..." | tee -a "$LOGFILE"
|
||||
if ! wget -q --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36" --load-cookies="$COOKIE_FILE" -O "$fname" "$url"; then
|
||||
echo "Failed to download $url, skipping." | tee -a "$LOGFILE"
|
||||
rm -f "$fname" || true
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
# sanity check file is .torrent-ish (contains bencoded data)
|
||||
# Check if file was actually downloaded and is not an HTML error page
|
||||
if [ ! -s "$fname" ]; then
|
||||
echo "Warning: $fname is empty, removing..." | tee -a "$LOGFILE"
|
||||
rm -f "$fname" || true
|
||||
continue
|
||||
fi
|
||||
|
||||
# Check if file is HTML (error page)
|
||||
# Check for authentication errors
|
||||
if grep -q "You don't have access to this torrent\|Download failed\|Access denied\|Authentication failed" "$fname" 2>/dev/null; then
|
||||
echo "ERROR: Authentication failed for $url - you don't have access to this torrent" | tee -a "$LOGFILE"
|
||||
echo "This suggests your passkey may be invalid or expired, or you don't have the required permissions." | tee -a "$LOGFILE"
|
||||
rm -f "$fname" || true
|
||||
continue
|
||||
fi
|
||||
if head -c 100 "$fname" | grep -q "<html|<HTML|<!DOCTYPE"; then
|
||||
echo "Warning: $fname appears to be an HTML error page, removing..." | tee -a "$LOGFILE"
|
||||
rm -f "$fname" || true
|
||||
continue
|
||||
fi
|
||||
if ! (head -c 20 "$fname" | grep -q "^d" && grep -a -q "info" "$fname") 2>/dev/null; then
|
||||
echo "Warning: $fname doesn't look like a valid torrent file; keeping it but check manually." | tee -a "$LOGFILE"
|
||||
# Check if it's an HTML error page
|
||||
if grep -q "<html\|<HTML" "$fname" 2>/dev/null; then
|
||||
echo "File appears to be HTML (possibly an error page). URL may be invalid or require authentication." | tee -a "$LOGFILE"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add to history file to avoid re-downloading
|
||||
echo "$url" >> "$HISTORY_FILE"
|
||||
done
|
||||
|
||||
# Collect .torrent files in tmpdir
|
||||
torrents=(*.torrent)
|
||||
# handle case where glob doesn't match
|
||||
if [[ ${#torrents[@]} -eq 1 && "${torrents[0]}" == '*.torrent' ]]; then
|
||||
echo "No .torrent files present after download. Exiting." | tee -a "$LOGFILE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Uploading ${#torrents[@]} .torrent file(s) to ${REMOTE_HOST}:${REMOTE_PATH}" | tee -a "$LOGFILE"
|
||||
|
||||
# Try SFTP first (SSH File Transfer Protocol on port 22)
|
||||
echo "Attempting SFTP upload..." | tee -a "$LOGFILE"
|
||||
if timeout 300 sshpass -p "${FTP_PASS}" sftp -o StrictHostKeyChecking=no -o ConnectTimeout=60 -P 22 "${FTP_USER}@${REMOTE_HOST}" <<EOF 2>&1 | tee -a "$LOGFILE"
|
||||
mkdir ${REMOTE_PATH}
|
||||
cd ${REMOTE_PATH}
|
||||
mput *.torrent
|
||||
bye
|
||||
EOF
|
||||
then
|
||||
echo "SFTP upload successful." | tee -a "$LOGFILE"
|
||||
else
|
||||
upload_rc=$?
|
||||
echo "SFTP upload failed (exit $upload_rc). Trying FTPS..." | tee -a "$LOGFILE"
|
||||
|
||||
# Fallback to FTPS
|
||||
timeout 300 lftp -u "${FTP_USER},${FTP_PASS}" "ftps://${REMOTE_HOST}" <<EOF 2>&1 | tee -a "$LOGFILE"
|
||||
set ftp:ssl-force true
|
||||
set ftp:ssl-protect-data true
|
||||
set ftp:use-feat true
|
||||
set ssl:verify-certificate false
|
||||
set ftp:passive-mode true
|
||||
set net:timeout 60
|
||||
set net:max-retries 3
|
||||
set net:reconnect-interval-base 5
|
||||
set ftp:prefer-epsv false
|
||||
debug 3
|
||||
# Make remote dir if needed, then upload
|
||||
mkdir -p "${REMOTE_PATH}" || true
|
||||
cd "${REMOTE_PATH}" || exit 1
|
||||
mput -- *.torrent
|
||||
bye
|
||||
EOF
|
||||
|
||||
ftps_rc=${PIPESTATUS[0]:-0}
|
||||
if [[ $ftps_rc -ne 0 ]]; then
|
||||
echo "FTPS also failed (exit $ftps_rc). Trying regular FTP..." | tee -a "$LOGFILE"
|
||||
|
||||
# Final fallback to regular FTP
|
||||
timeout 300 lftp -u "${FTP_USER},${FTP_PASS}" "ftp://${REMOTE_HOST}" <<EOF 2>&1 | tee -a "$LOGFILE"
|
||||
set ftp:passive-mode true
|
||||
set net:timeout 60
|
||||
set net:max-retries 3
|
||||
set net:reconnect-interval-base 5
|
||||
set ftp:prefer-epsv false
|
||||
debug 3
|
||||
# Make remote dir if needed, then upload
|
||||
mkdir -p "${REMOTE_PATH}" || true
|
||||
cd "${REMOTE_PATH}" || exit 1
|
||||
mput -- *.torrent
|
||||
bye
|
||||
EOF
|
||||
|
||||
ftp_rc=${PIPESTATUS[0]:-0}
|
||||
if [[ $ftp_rc -ne 0 ]]; then
|
||||
echo "All upload methods failed (SFTP, FTPS, FTP). See $LOGFILE" | tee -a "$LOGFILE"
|
||||
exit $ftp_rc
|
||||
fi
|
||||
echo "FTP fallback upload successful." | tee -a "$LOGFILE"
|
||||
else
|
||||
echo "FTPS upload successful." | tee -a "$LOGFILE"
|
||||
fi
|
||||
fi
|
||||
|
||||
# optional cleanup
|
||||
if [[ "${KEEP_LOCAL}" = false ]]; then
|
||||
echo "Removing local torrent files..." | tee -a "$LOGFILE"
|
||||
rm -f -- *.torrent || true
|
||||
fi
|
||||
|
||||
echo "Done. Log: $LOGFILE"
|
||||
exit 0
|
||||
@@ -1,7 +1,9 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p bash trashy fd ripgrep file jq curl
|
||||
|
||||
directories=("$HOME/Pictures/To Organize/" "$HOME/Downloads/" "$HOME/Downloads/cache")
|
||||
directories=("$HOME/Pictures/unorganized/" "$HOME/Downloads/" "$HOME/Downloads/cache")
|
||||
screenshots_dir=$HOME/Pictures/screenshots/
|
||||
photos_dir=$HOME/Pictures/photos/camera/
|
||||
|
||||
replace_extension() {
|
||||
local file_basename
|
||||
@@ -45,12 +47,11 @@ while IFS= read -r file; do
|
||||
if ! basename "$file" | rg -q 'Screenshot_\d{8}'; then
|
||||
continue
|
||||
fi
|
||||
echo "moving screenshot $file into $HOME/Pictures/Screenshots/"
|
||||
command mv -n "$file" "$HOME/Pictures/Screenshots/"
|
||||
echo "moving screenshot $file into $screenshots_dir"
|
||||
command mv -n "$file" "$screenshots_dir"
|
||||
done < <(fd . "${directories[@]}" -d 1 -tf --absolute-path)
|
||||
|
||||
# screenshots=$HOME/Pictures/Screenshots
|
||||
classify_directories=("$HOME/Pictures/Screenshots" "$HOME/Pictures/Photos/Camera")
|
||||
classify_directories=("$screenshots_dir" "$photos_dir")
|
||||
if (($(fd . "${classify_directories[@]}" -tf -d 1 | wc -l) > 0)); then
|
||||
while IFS= read -r file; do
|
||||
date=$(stat -c "%y" "$file" | rg -o "\d{4}-\d{2}-\d{2}")
|
||||
@@ -101,7 +102,7 @@ while IFS= read -r game_dir; do
|
||||
continue
|
||||
fi
|
||||
# Modify this to store your screenshots somewhere else
|
||||
dir_dest=$(realpath "$HOME/Pictures/Screenshots/Games")/"$game_name"
|
||||
dir_dest=$(realpath "$screenshots_dir/Games")/"$game_name"
|
||||
dir_game=$(realpath "$dir_steam")/"$game_id"/screenshots
|
||||
# If there are not screenshots currently stored, why bother lol
|
||||
if ! [[ -d $dir_game ]]; then
|
||||
@@ -120,7 +121,7 @@ cyberpunk_dir=$HOME/Games/gog/cyberpunk-2077/drive_c/users/jawz/Pictures/"Cyberp
|
||||
if [[ -d $cyberpunk_dir ]]; then
|
||||
while IFS= read -r file; do
|
||||
echo "Moving cyberpunk screenshots $(basename "$file")"
|
||||
command mv -n "$file" "$HOME/Pictures/Screenshots/Games/Cyberpunk 2077/"
|
||||
command mv -n "$file" "$screenshots_dir/Games/Cyberpunk 2077/"
|
||||
done < <(fd . "$cyberpunk_dir" -tf)
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user