diff --git a/bargo.py b/bargo.py index 9d166b5..a4a6edd 100755 --- a/bargo.py +++ b/bargo.py @@ -11,6 +11,9 @@ import create_git_repo as repo import util.color_io as io 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/" git_ignore = """cmake-build*/ @@ -208,10 +211,11 @@ if args.create_git: desc = "" if isinstance(args.create_git, str): 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("/"): github_url += "/" 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("${LINKS}", links) diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..ffdc5c8 --- /dev/null +++ b/default.nix @@ -0,0 +1,10 @@ +let + pkgs = import {}; +in pkgs.mkShell { + packages = [ + pkgs.git + (pkgs.python3.withPackages (python-pkgs: [ + python-pkgs.requests + ])) + ]; +} diff --git a/nixpkgs/blt-utils/default.nix b/nixpkgs/blt-utils/default.nix new file mode 100644 index 0000000..cffb0f4 --- /dev/null +++ b/nixpkgs/blt-utils/default.nix @@ -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"; + }; +} \ No newline at end of file