mirror of
https://github.com/nix-community/nix-init.git
synced 2024-11-04 13:17:06 +03:00
Generate Nix packages from URLs with hash prefetching, dependency inference, license detection, and more [maintainer=@figsoda]
78da5e2a2a
Bumps [toml](https://github.com/toml-rs/toml) from 0.8.0 to 0.8.1. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.0...toml-v0.8.1) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> |
||
---|---|---|
.github | ||
assets | ||
license-store-cache | ||
scripts | ||
src | ||
.gitignore | ||
build.rs | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
flake.lock | ||
flake.nix | ||
LICENSE | ||
README.md | ||
rustfmt.toml |
nix-init
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
andvendorHash
- Dependency inference for Rust, Go, 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, --commit[=<COMMIT>] Commit the changes if the output path is name-based (RFC 140) [possible values: true, false]
-c, --config <CONFIG> Specify the config file
-h, --help Print help
-V, --version Print version
Supported builders
stdenv.mkDerivation
buildRustPackage
buildPythonApplication
andbuildPythonPackage
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 (in nix), equivalent to `--nixpkgs`
nixpkgs = "<nixpkgs>" # use the nixpkgs from channels (default)
# nixpkgs = 'builtins.getFlake "nixpkgs"' # use the nixpkgs from the flake registry
# commit the changes if the output path is name-based (RFC 140)
# see https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name for more information
commit = true
# 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