All Projects → yusdacra → rust-nix-templater

yusdacra / rust-nix-templater

Licence: MIT license
Generates Nix build / dev files for Rust projects.

Programming Languages

rust
11053 projects
Nix
1067 projects

Projects that are alternatives of or similar to rust-nix-templater

Naersk
Build rust crates in Nix. No configuration, no code generation, no IFD. Sandbox friendly.
Stars: ✭ 193 (+293.88%)
Mutual labels:  nix, cargo
dotfiles
My NixOS configuration featuring awesome and neovim
Stars: ✭ 40 (-18.37%)
Mutual labels:  nix, flakes
nvfetcher
Generate nix sources expr for the latest version of packages
Stars: ✭ 95 (+93.88%)
Mutual labels:  nix, flakes
naersk
Build rust crates in Nix. No configuration, no code generation, no IFD. Sandbox friendly. [maintainer: @Patryk27]
Stars: ✭ 440 (+797.96%)
Mutual labels:  nix, cargo
nix-unstable-installer
A place to host Nix unstable releases.
Stars: ✭ 96 (+95.92%)
Mutual labels:  nix, flakes
microvm.nix
NixOS MicroVMs
Stars: ✭ 136 (+177.55%)
Mutual labels:  nix, flakes
crane
A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.
Stars: ✭ 348 (+610.2%)
Mutual labels:  nix, cargo
dotfiles
My personal dotfiles
Stars: ✭ 71 (+44.9%)
Mutual labels:  nix, flakes
nixcfg
My nix configuration(s), using flakes. It's my laptop, it's my servers, it's my everything, in code.
Stars: ✭ 44 (-10.2%)
Mutual labels:  nix, flakes
nixcrates
DEPRECATED reads rust-lang/crates.io-index and outputs nix expressions into fractalide/nix-crates-index
Stars: ✭ 14 (-71.43%)
Mutual labels:  nix, cargo
Crate2nix
nix build file generator for rust crates
Stars: ✭ 123 (+151.02%)
Mutual labels:  nix, cargo
Site
The new frontend/backend code for https://christine.website
Stars: ✭ 220 (+348.98%)
Mutual labels:  nix
Getting Started Nix Template
Based on nix.dev tutorials, repository template to get you started with Nix.
Stars: ✭ 196 (+300%)
Mutual labels:  nix
Emacs Overlay
Bleeding edge emacs overlay [[email protected]]
Stars: ✭ 194 (+295.92%)
Mutual labels:  nix
Nox
Tools to make nix nicer to use
Stars: ✭ 232 (+373.47%)
Mutual labels:  nix
Nix 1p
A (more or less) one page introduction to Nix, the language.
Stars: ✭ 219 (+346.94%)
Mutual labels:  nix
Nixbox
NixOS Vagrant boxes [[email protected]]
Stars: ✭ 189 (+285.71%)
Mutual labels:  nix
Nix Docker
Docker images for the Nix package manager
Stars: ✭ 189 (+285.71%)
Mutual labels:  nix
Comma
Stars: ✭ 186 (+279.59%)
Mutual labels:  nix
Mach Nix
Create highly reproducible python environments
Stars: ✭ 231 (+371.43%)
Mutual labels:  nix

THIS PROJECT IS NO LONGER MAINTAINED

rust-nix-templater

Generates Rust projects that use nix-cargo-integration.

Features

  • Support for both flakes and legacy nix
  • Cachix support
  • Desktop file generation
  • CI file generation (GitHub Actions and GitLab CI)
  • Creates Cargo project if one is not found in output directory
  • See nix-cargo-integration for more information.

Installation

Run without installing by executing nix run github:yusdacra/rust-nix-templater -- --help.

  • Flakes: nix profile install github:yusdacra/rust-nix-templater
  • Legacy: nix-env -i -f "https://github.com/yusdacra/rust-nix-templater/tarball/master"

Examples

Simple:

rust-nix-templater -l mit -n example
# is equal to
rust-nix-templater --license mit --name example

This will generate files in the current directory, with license set to mit and package name set to example. It will generate both build and development environment files. If the current directory doesn't already have a Cargo project, this will create one.

For a project that is hosted on GitHub:

rust-nix-templater --github-ci -l mit -n example
# is equal to
rust-nix-templater --github-ci -l mit -n example

This will do what the first example does and also generate a GitHub Actions workflow.

For more options please check rust-nix-templater --help.

Usage

rust-nix-templater 0.4.0
Generates Nix files for Rust projects which uses naersk

USAGE:
    rust-nix-templater [FLAGS] [OPTIONS]

FLAGS:
    -A, --no-app           Whether to disable app output for flake
        --disable-build    Disable app / builds flake output generation
        --github-ci        Enable GitHub Actions file generation
        --gitlab-ci        Enable GitLab CI file generation
        --help             Prints help information
    -V, --version          Prints version information

OPTIONS:
        --cachix-name <cachix-name>                      Cachix cache name. [example: --cachix-name rust-nix-templater]
        --cachix-public-key <cachix-public-key>
            Cachix cache public key. [example: --cachix-public-key "rust-nix-templater.cachix.org-
            1:Tmy1V0KK+nxzg0XFePL/++t4JRKAw5tvr+FNfHz7mIY=""]
    -o, --out-dir <out-dir>
            Output directory where generated files will be put in. [example: -o example] [default: .]

    -d, --description <package-description>              A short, single line description of the package
    -h, --homepage <package-homepage>
            Homepage of the package. [example: -h "https://gitlab.com/example/example"]

        --icon <package-icon>
            Icon to use in the generated desktop file. [example: --icon assets/icon.ico]

    -l, --license <package-license>
            License of the package. Must be a valid Cargo.toml license. [example: mit]

    -D, --long-description <package-long-description>    A longer description of the package
    -n, --name <package-name>
            Name of the package. Must be passed when also creating a Cargo project. [example: icy_matrix]

    -s, --systems <package-systems>...
            Systems that the package is supported on. [example: -s x86_64-linux x86_64-darwin] [default: nixpkgs default
            systems]
        --xdg-categories <package-xdg-categories>
            Categories to put in the generated desktop file. [example: --xdg-categories "Network;InstantMessaging;"]

        --xdg-comment <package-xdg-comment>
            Comment to put in the generated desktop file. [default: package description]

        --xdg-desktop-name <package-xdg-desktop-name>
            Desktop name to put in the generated desktop file. Defaults to package name. [example: --xdg-desktop-name
            "Icy Matrix"]
        --xdg-generic-name <package-xdg-generic-name>
            Generic name to put in the generated desktop file. [example: --xdg-generic-name "Matrix Client"]

Development

Building

The Nix flake provides two main build types: release and debug, akin to the Cargo build types.

For debugging, build with debug symbols, but don't test:

nix build .#rust-nix-templater-dev

For release, which compiles in Cargo release mode:

nix build .#rust-nix-templater
# or
nix build

Testing

With Nix flakes, you can check the flake.nix format and run the tests with:

nix flake check

This will build and test the rust-nix-templater-tests attribute (which also runs Cargo tests).

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].