Brett 2024-09-26 17:05:05 -04:00
parent 3e6e56f7f6
commit 56adfcda63
3 changed files with 64 additions and 1 deletions

View File

@ -11,6 +11,9 @@ import create_git_repo as repo
import util.color_io as io import util.color_io as io
scripts_dir = "/home/brett/Documents/code/scripts" scripts_dir = "/home/brett/Documents/code/scripts"
dir_path = os.path.dirname(os.path.realpath(__file__))
if not dir_path.endswith("/"):
dir_path += "/"
github_url = "https://github.com/Tri11Paragon/" github_url = "https://github.com/Tri11Paragon/"
git_ignore = """cmake-build*/ git_ignore = """cmake-build*/
@ -208,10 +211,11 @@ if args.create_git:
desc = "" desc = ""
if isinstance(args.create_git, str): if isinstance(args.create_git, str):
desc = args.create_git desc = args.create_git
open_process(["create_git_repo", "-d", desc, project_name]) open_process(["python3", dir_path + "create_git_repo.py", "-d", desc, project_name])
if not github_url.endswith("/"): if not github_url.endswith("/"):
github_url += "/" github_url += "/"
open_process(["git", "remote", "add", "origin", github_url + project_name]) open_process(["git", "remote", "add", "origin", github_url + project_name])
open_process(["git", "branch", "--set-upstream-to=origin/main", "main"])
cmake_text = cmake_text.replace("${SUB_DIRS}", sub_dirs) cmake_text = cmake_text.replace("${SUB_DIRS}", sub_dirs)
cmake_text = cmake_text.replace("${LINKS}", links) cmake_text = cmake_text.replace("${LINKS}", links)

10
default.nix Normal file
View File

@ -0,0 +1,10 @@
let
pkgs = import <nixpkgs> {};
in pkgs.mkShell {
packages = [
pkgs.git
(pkgs.python3.withPackages (python-pkgs: [
python-pkgs.requests
]))
];
}

View File

@ -0,0 +1,49 @@
{ lib, buildPythonPackage, fetchFromGitHub, requests, bs4, withAlias ? false, update-python-libraries}:
buildPythonPackage rec {
pname = "blt-utils";
# The websites yt-dlp deals with are a very moving target. That means that
# downloads break constantly. Because of that, updates should always be backported
# to the latest stable release.
version = "2024.09.12";
pyproject = true;
src = fetchFromGitHub {
owner = "Tri11Paragon";
repo = "Scripts";
rev = "aca23524522bb853190c8aa82c45a60dfdd80b50";
hash = "";
};
build-system = [];
dependencies = [
requests
bs4
];
pythonRelaxDeps = [ "requests" ];
postInstall = lib.optionalString withAlias ''
ln -s "$out/commit.py" "$out/bin/commit.py"
'';
passthru.updateScript = [ update-python-libraries (toString ./.) ];
meta = with lib; {
homepage = "https://github.com/yt-dlp/yt-dlp/";
description = "Command-line tool to download videos from YouTube.com and other sites (youtube-dl fork)";
longDescription = ''
yt-dlp is a youtube-dl fork based on the now inactive youtube-dlc.
youtube-dl is a small, Python-based command-line program
to download videos from YouTube.com and a few more sites.
youtube-dl is released to the public domain, which means
you can modify it, redistribute it or use it however you like.
'';
changelog = "https://github.com/yt-dlp/yt-dlp/releases/tag/${version}";
license = licenses.unlicense;
maintainers = with maintainers; [ mkg20001 SuperSandro2000 ];
mainProgram = "yt-dlp";
};
}