NIX-PREFETCH-GITHUB(1)

πŸ“¦
version 7.1.0 Β· 3 versions
, in nixpkgs unstable

πŸ’… NIX-PREFETCH-GITHUB(1) πŸ’…

Okay bestie, welcome to the manual page for nix-prefetch-github β€” yes, that’s literally the manual name β€” and we’re on the NIX-PREFETCH-GITHUB(1) page, version 7.1.0. It’s giving β€œtool that generates nix arguments so you don’t have to suffer manually.” Let’s go. ✨


✨ NAME ✨

  • nix-prefetch-github β€” the nix-prefetch-github 7.1.0 page, periodt. πŸ’–

πŸš€ NIX-PREFETCH-GITHUB πŸš€

Use this program to generate the arguments for the fetchFromGitHub nix function. That’s the whole vibe. 🫢

usage: nix-prefetch-github [-h] [--fetch-submodules] [--no-fetch-submodules]
                           [--leave-dot-git] [--no-leave-dot-git]
                           [--deep-clone] [--no-deep-clone] [--verbose]
                           [--quiet] [--nix] [--json] [--meta] [--version]
                           [--rev REV]
                           owner repo

πŸ“ Positional Arguments πŸ“

  • owner β€” first positional argument. The original page gives no extra description here, so we’re not inventing one. πŸ’…
  • repo β€” second positional argument. Same deal: no extra description in the original. 🫢

πŸŽ›οΈ Named Arguments πŸŽ›οΈ

  • --fetch-submodules β€” include git submodules in the output derivation. Default: PrefetchOptions(fetch_submodules=False, deep_clone=False, leave_dot_git=False). 🧚
  • --no-fetch-submodules β€” don’t include git submodules in output derivation. 🚫
  • --leave-dot-git β€” include .git folder in output derivation. Use this if you need repository data, e.g. current commit hash, for the build process. πŸ”₯
  • --no-leave-dot-git β€” don’t include .git folder in output derivation. πŸ™ˆ
  • --deep-clone β€” include all of the repository history in the output derivation. This option implies --leave-dot-git. πŸ‘‘
  • --no-deep-clone β€” don’t include the repository history in the output derivation. πŸ’€
  • --verbose, -v β€” print additional information about the programs execution. This is useful if you want to issue a bug report. Default: LoggingConfiguration(output_file=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, log_level=30). πŸ›
  • --quiet, -q β€” print less information about the programs execution. 🀫
  • --nix β€” output the results as valid nix code. Default: RenderingFormat.json. 🌈
  • --json β€” output the results in the JSON format. ⭐
  • --meta β€” output the results in JSON format where the arguments to fetchFromGitHub are located under the src key of the resulting json dictionary and meta information about the prefetched repository is located under the meta key of the output. πŸŽ€
  • --version β€” show program’s version number and exit. πŸ‘‹
  • --rev β€” the original page lists this with no description, so we’re leaving it exactly that way. No invented lore. 🫢

πŸ“ NIX-PREFETCH-GITHUB-DIRECTORY πŸ“

Use this program to generate a nix expression for fetchFromGitHub based on the git repository in the local directory. Local-directory main character energy. πŸ¦‹

usage: nix-prefetch-github-directory [-h] [--fetch-submodules]
                                     [--no-fetch-submodules] [--leave-dot-git]
                                     [--no-leave-dot-git] [--deep-clone]
                                     [--no-deep-clone] [--verbose] [--quiet]
                                     [--nix] [--json] [--meta] [--version]
                                     [--directory DIRECTORY] [--remote REMOTE]

πŸŽ›οΈ Named Arguments πŸŽ›οΈ

  • --fetch-submodules β€” include git submodules in the output derivation. Default: PrefetchOptions(fetch_submodules=False, deep_clone=False, leave_dot_git=False). 🧚
  • --no-fetch-submodules β€” don’t include git submodules in output derivation. 🚫
  • --leave-dot-git β€” include .git folder in output derivation. Use this if you need repository data, e.g. current commit hash, for the build process. πŸ”₯
  • --no-leave-dot-git β€” don’t include .git folder in output derivation. πŸ™ˆ
  • --deep-clone β€” include all of the repository history in the output derivation. This option implies --leave-dot-git. πŸ‘‘
  • --no-deep-clone β€” don’t include the repository history in the output derivation. πŸ’€
  • --verbose, -v β€” print additional information about the programs execution. This is useful if you want to issue a bug report. Default: LoggingConfiguration(output_file=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, log_level=30). πŸ›
  • --quiet, -q β€” print less information about the programs execution. 🀫
  • --nix β€” output the results as valid nix code. Default: RenderingFormat.json. 🌈
  • --json β€” output the results in the JSON format. ⭐
  • --meta β€” output the results in JSON format where the arguments to fetchFromGitHub are located under the src key of the resulting json dictionary and meta information about the prefetched repository is located under the meta key of the output. πŸŽ€
  • --version β€” show program’s version number and exit. πŸ‘‹
  • --directory β€” the original page lists this with no description, so no extra description from me. πŸ’…
  • --remote β€” Default: 'origin'. 🧭

🏷️ NIX-PREFETCH-LATEST-RELEASE 🏷️

Use this program to generate a nix expression for the latest release of a github repository. Latest release, no cap. πŸ“

usage: nix-prefetch-github-latest-release [-h] [--fetch-submodules]
                                          [--no-fetch-submodules]
                                          [--leave-dot-git]
                                          [--no-leave-dot-git] [--deep-clone]
                                          [--no-deep-clone] [--verbose]
                                          [--quiet] [--nix] [--json] [--meta]
                                          [--version]
                                          owner repo

πŸ“ Positional Arguments πŸ“

  • owner β€” first positional argument. The original gives no description, so we’re keeping it cute and empty. πŸ’–
  • repo β€” second positional argument. Same energy: no description in the original. 🫢

πŸŽ›οΈ Named Arguments πŸŽ›οΈ

  • --fetch-submodules β€” include git submodules in the output derivation. Default: PrefetchOptions(fetch_submodules=False, deep_clone=False, leave_dot_git=False). 🧚
  • --no-fetch-submodules β€” don’t include git submodules in output derivation. 🚫
  • --leave-dot-git β€” include .git folder in output derivation. Use this if you need repository data, e.g. current commit hash, for the build process. πŸ”₯
  • --no-leave-dot-git β€” don’t include .git folder in output derivation. πŸ™ˆ
  • --deep-clone β€” include all of the repository history in the output derivation. This option implies --leave-dot-git. πŸ‘‘
  • --no-deep-clone β€” don’t include the repository history in the output derivation. πŸ’€
  • --verbose, -v β€” print additional information about the programs execution. This is useful if you want to issue a bug report. Default: LoggingConfiguration(output_file=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, log_level=30). πŸ›
  • --quiet, -q β€” print less information about the programs execution. 🀫
  • --nix β€” output the results as valid nix code. Default: RenderingFormat.json. 🌈
  • --json β€” output the results in the JSON format. ⭐
  • --meta β€” output the results in JSON format where the arguments to fetchFromGitHub are located under the src key of the resulting json dictionary and meta information about the prefetched repository is located under the meta key of the output. πŸŽ€
  • --version β€” show program’s version number and exit. πŸ‘‹

πŸ”‘ GITHUB API TOKEN πŸ”‘

All the commands provided by this package will read the environment variable GITHUB_TOKEN and use its content verbatim as an authentication/authorization token when requesting from GitHubs API. That’s the token vibe. πŸ”

The different command line programs of this package provide different output formats. Those can be selected via different arguments provided to the program. ✨


🧾 JSON OUTPUT 🧾

The --json argument is the default and will render the output as JSON to the standard output of the program. The resulting json value will consist of a single dictionary where all key value pairs correspond to the arguments to the fetchFromGitHub function provided by nixpkgs. It is intended to be used directly in nix code:

src = with builtins; fetchFromGitHub (fromJSON (readFile ./nix-prefetch-github-output.json))

That’s literally the whole JSON moment. Clean, direct, iconic. πŸ’…


πŸͺ„ META INFORMATION OUTPUT πŸͺ„

The --meta argument produces output similar to the output produced by --json. The difference is that a nested dictionary is produced with two top level keys: src and meta. The src key will contain the same data as would have been yielded by --json whereas the meta key contains some meta data on the commit that was fetched. At the moment this will only be the date and time of day of the latest commit. This can be useful when providing nightly versions of a package:

let fetchedSourceCode = (fromJSON (readFile ./nix-prefetch-github-output.json));
in buildPackage {
  pname = "my-package";
  version = fetchedSourceCode.meta.commitDate;
  src = fetchFromGitHub fetchedSourceCode.src;
  ...
};

Nightly versions said β€œlet me be metadata-coded.” πŸŒ™


🧱 NIX OUTPUT 🧱

Consider this a legacy output format without any practical applications. The --nix argument will result in a valid nix expression produced by the respective program.

Legacy, yes. Still valid nix, yes. We don’t make the rules. 🫠


πŸ‘‘ Author πŸ‘‘

Sebastian Jordan. Iconic author behavior. πŸ’œ


2022, Sebastian Jordan.


Byeee bestie! This was the NIX-PREFETCH-GITHUB(1) page from nix-prefetch-github 7.1.0, dated Jan 02, 1980 β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from