Generate Nix packages from URLs with hash prefetching, dependency inference, license detection, and more [maintainer=@figsoda]
Go to file
dependabot[bot] 2996e25a82
build(deps): bump clap from 4.3.4 to 4.3.5
Bumps [clap](https://github.com/clap-rs/clap) from 4.3.4 to 4.3.5.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.3.4...v4.3.5)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-21 09:04:31 +00:00
.github build(deps): bump cachix/install-nix-action from 21 to 22 2023-06-19 09:09:09 +00:00
assets assets: add readme 2023-04-21 12:25:09 -04:00
license-store-cache license-store-cache: publish = false 2023-03-18 10:39:12 -04:00
scripts rust: add tests for dependency inference 2023-03-18 11:50:26 -04:00
src rust(deps): add curl to nativeBuildInputs too 2023-06-20 11:40:56 -04:00
.gitignore move license store cache to its own derivation 2023-03-12 12:30:13 -04:00
build.rs build: remove unused rerun-if commands 2023-03-22 11:05:33 -04:00
Cargo.lock build(deps): bump clap from 4.3.4 to 4.3.5 2023-06-21 09:04:31 +00:00
Cargo.toml build(deps): bump clap from 4.3.4 to 4.3.5 2023-06-21 09:04:31 +00:00
CHANGELOG.md bump 2023-04-29 19:13:51 -04:00
flake.lock flake: refactor 2023-06-14 20:48:05 -04:00
flake.nix flake: refactor 2023-06-14 20:48:05 -04:00
LICENSE initial commit 2023-01-18 14:35:23 -05:00
README.md readme: add matrix link 2023-04-21 12:49:08 -04:00
rustfmt.toml initial commit 2023-01-18 14:35:23 -05:00

nix-init

matrix release version deps license ci

Generate Nix packages from URLs

Note: It is likely that the generated package will not work without some tweaks, also remember to double check the license and description even if it does work

  • Hash prefetching powered by nurl with support for cargoHash and vendorHash
  • Dependency inference for Rust and Python projects
  • Interactive prompts with fuzzy tab completions
  • License detection

Installation

The latest release of nix-init is packaged in nixpkgs and kept up to date on the unstable branches

If you want to use a more recent snapshot of nix-init, it is also available as a flake. The following command is equivalent to running nix-init --help:

nix run github:nix-community/nix-init -- --help

or if you don't have flakes enabled:

nix run --extra-experimental-features "flakes nix-command" github:nix-community/nix-init -- --help

Usage

Usage: nix-init [OPTIONS] [OUTPUT]

Arguments:
  [OUTPUT]  The path or directory to output the generated file to

Options:
  -u, --url <URL>          Specify the URL
  -n, --nixpkgs <NIXPKGS>  Path to nixpkgs (in nix)
  -c, --config <CONFIG>    Specify the config file
  -h, --help               Print help
  -V, --version            Print version

Supported builders

  • stdenv.mkDerivation
  • buildRustPackage
  • buildPythonApplication and buildPythonPackage
  • buildGoModule

Supported fetchers

  • fetchCrate
  • fetchFromGitHub
  • fetchFromGitLab
  • fetchFromGitea
  • fetchPypi
  • All other fetchers supported by nurl are also supported, you just have to manually input the tag/revision of the package

Configuration

nix-init will try to find nix-init/config.toml under XDG configuration directories

# ~/.config/nix-init/config.toml

# maintainers that will get added to the package meta
maintainers = ["figsoda"]

# path to nixpkgs, equivalent to `--nixpkgs`
nixpkgs = "<nixpkgs>"

# access tokens to access private repositories and avoid rate limits
[access-tokens]
"github.com" = "ghp_blahblahblah..."
"gitlab.com".command = ["secret-tool", "or", "whatever", "you", "use"]
"gitlab.gnome.org".file = "/path/to/api/token"

Changelog

See CHANGELOG.md