All Projects → seppeljordan → nix-prefetch-github

seppeljordan / nix-prefetch-github

Licence: GPL-3.0 License
Prefetch sources from github for nix build tool

Programming Languages

python
139335 projects - #7 most used programming language
Nix
1067 projects
shell
77523 projects

Labels

Projects that are alternatives of or similar to nix-prefetch-github

nixpkgs-python-importer
Violate Nix philosophy, install Python packages mid-session with `from nixpkgs.scipy import scipy`.
Stars: ✭ 27 (+8%)
Mutual labels:  nix
high-quality-nix-content
GitHub repository containing highest quality Nix/NixOS content
Stars: ✭ 88 (+252%)
Mutual labels:  nix
nixcrates
DEPRECATED reads rust-lang/crates.io-index and outputs nix expressions into fractalide/nix-crates-index
Stars: ✭ 14 (-44%)
Mutual labels:  nix
dotfiles
NixOS system config & Home-Manager user config
Stars: ✭ 43 (+72%)
Mutual labels:  nix
purs-nix
Manage your PureScript projects with Nix!
Stars: ✭ 27 (+8%)
Mutual labels:  nix
nixos-config
My NixOS configuration
Stars: ✭ 23 (-8%)
Mutual labels:  nix
haskell-template
Haskell project template using Nix + Flakes + VSCode (HLS)
Stars: ✭ 68 (+172%)
Mutual labels:  nix
nix-new-rails-app
Initialize Rails applications using Nix and development environments (nix-shell)
Stars: ✭ 27 (+8%)
Mutual labels:  nix
dotfiles
Dotfiles for my NixOS system based on Dracula theme
Stars: ✭ 39 (+56%)
Mutual labels:  nix
docker-nix
Docker image for nix [maintainer=@zimbatm] [status=deprecated]
Stars: ✭ 38 (+52%)
Mutual labels:  nix
grafanix
Visualize your Nix dependencies!
Stars: ✭ 38 (+52%)
Mutual labels:  nix
dotfiles
No place like ~. Nix. All. The. Things.
Stars: ✭ 48 (+92%)
Mutual labels:  nix
nixpkgs-python
nixpkgs-python is automatically (via pypi2nix) managed collection of nix+python expressions
Stars: ✭ 17 (-32%)
Mutual labels:  nix
nixery
Container registry which transparently builds images using the Nix package manager. Canonical repository is https://cs.tvl.fyi/depot/-/tree/tools/nixery
Stars: ✭ 1,365 (+5360%)
Mutual labels:  nix
stackage2nix
Generate Nix build instructions from a Stack file
Stars: ✭ 48 (+92%)
Mutual labels:  nix
nix-filter
a small self-container source filtering lib
Stars: ✭ 68 (+172%)
Mutual labels:  nix
canonix
Experiment in Nix formatting
Stars: ✭ 18 (-28%)
Mutual labels:  nix
nix-bash-completions
Bash completion for the Nix command line tools
Stars: ✭ 39 (+56%)
Mutual labels:  nix
makes
A DevSecOps framework powered by Nix.
Stars: ✭ 158 (+532%)
Mutual labels:  nix
nixos-on-arm
Cross Compiling NixOS to ARM as a replacement for Yocto
Stars: ✭ 129 (+416%)
Mutual labels:  nix

nix-prefetch-github

This module implements a python function and a command line tool to help you fetch sources from github when using fetchFromGitHub.

This program can be distributed under the conditions of the GNU Public License Version 3. Check out LICENSE.txt to read the license text.

command line example

$ nix-prefetch-github seppeljordan nix-prefetch-github
{
    "owner": "seppeljordan",
    "repo": "nix-prefetch-github",
    "rev": "856d511bd65dec00bfa2bee6b68b1479699def3d",
    "sha256": "ACSWdkcCCfptbkusYiPs5j651tC62JN+W4s5gdWhEdk=",
    "fetchSubmodules": false,
    "leaveDotGit": false,
    "deepClone": false
}

available commands

nix-prefetch-github

This command downloads the code from a github repository and puts it into the local nix store. It also prints the function arguments to fetchFromGitHub to the standard output.

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

positional arguments:
  owner
  repo

optional arguments:
  -h, --help            show this help message and exit
  --fetch-submodules
  --no-fetch-submodules
  --leave-dot-git
  --no-leave-dot-git
  --deep-clone
  --no-deep-clone
  --verbose, -v
  --nix
  --json
  --rev REV
  --version, -V

nix-prefetch-github-directory

This command examins the current working directory and tries to figure out if it is part of a git repository linked to github. If this was successful the program prefetches the currently checked out commit from the origin remote repository similar to the command nix-prefetch-github.

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

optional arguments:
  -h, --help            show this help message and exit
  --fetch-submodules
  --no-fetch-submodules
  --leave-dot-git
  --no-leave-dot-git
  --deep-clone
  --no-deep-clone
  --verbose, -v
  --nix
  --json
  --directory DIRECTORY
  --remote REMOTE

nix-prefetch-github-latest-release

This command fetches the code for the latest release of the specified repository.

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

positional arguments:
  owner
  repo

optional arguments:
  -h, --help            show this help message and exit
  --fetch-submodules
  --no-fetch-submodules
  --leave-dot-git
  --no-leave-dot-git
  --deep-clone
  --no-deep-clone
  --verbose, -v
  --nix
  --json
  --version, -V

development environment

Use nix develop with flake support enabled. Development without nix flake support is not officially supported. Run the provided tests via python -m unittest discover. You can control what kind of tests are run via the variable DISABLED_TESTS:

# Only run tests that don't hit network and don't use nix
DISABLED_TESTS="network requires_nix_build" python -m unittest discover

Currently network and requires_nix_build are the only values that make sense with this environment variable.

changes

v5.0.1

  • Fix breaking bug in hash generation

v5.0.0

  • Remove all dependencies to other python packages other than "core" ones
  • Allow users to control debugging output via the --verbosity cli option
  • All commands now understand --fetch-submodules and --no-fetch-submodules options
  • Commands now understand --leave-dot-git and --no-leave-dot-git options
  • Commands now understand --deep-clone and --no-deep-clone

v4.0.4

  • Print standard error output of subprocesses for better debugging

v4.0.3

  • Generated hashes now don't have a "sha256-" prefix
  • jinja2 is no longer a dependency of nix-prefetch-github

v4.0.2

  • packaging release, no bugfixes or features

v4.0.1

  • Fix issue #38

v4.0

  • Make fetching submodules the default in calls to python routines. The CLI should be uneffected by this change.
  • Remove default values for fetch_submodules in all internal classes.
  • Implement nix-prefetch-github-latest-release command

v3.0

  • major changes to the internal module structure
  • introduction of the nix-prefetch-github-directory command
  • code repository now functions as a nix flake

v2.4

  • added --fetch-submodules flag
  • Fixed incompability with nix 2.4

v2.3.2

  • fix issues #21, #22
  • nix-prefetch-github now accepts full ref names, e.g. refs/heads/master which was broken since 2.3 (#23)

v2.3.1

  • Fix bug in generated nix expression
  • Fix bug that prevented targeting tags with prefetch command
  • Improve error message format in case revision is not found

v2.3

  • Remove dependency to requests
  • Default to master branch instead of first branch in list

v2.2

  • Add --version flag
  • Fix bug in output formatting

v2.1

  • Fix bug (#4) that made nix-prefetch-github incompatible with nix 2.2.

v2.0

  • The result of nix_pretch_github and its corresponding command line tool now contains always the actual commit hash as detected by the tool instead of the branch or tag name.
  • Add a new flag --nix that makes the command line tool output a valid nix expression
  • Removed the --hash-only and --no-hash-only flags and changed add --prefetch and --no-prefetch flags to replace them.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].