Giter VIP home page Giter VIP logo

nixify's Introduction

Description

Simple, yet extensible, batteries-included Nix flake bootstrapping library for real-world projects with focus on building reproducible, portable binary artifacts for various targets efficiently and with little to no configuration.

Features

  • 0-config reproducible, portable binary artifacts
    • Cross-compilation out-of-the-box
    • Tiny OCI (Docker) images with statically-linked binaries out-of-the-box
  • Automatic per-system flake generation from a shared definition with consistent API
  • Source filtering

Usage

Generic flakes

nixify.lib.mkFlake provides the flake construction functionality that all other language specific subsystems rely upon. It can be used to build a plain Nix flake or a generic project in your language of choice.

Examples

Rust

nixify relies on two files to "Nixify" Rust projects:

  • Cargo.toml (required), where pname and version will be taken from. Note, that virtual manifests are supported as well.
  • rust-toolchain.toml (optional). If exists, nixify will set up the Rust toolchain using data contained in this file. For cross-compilation scenarios, nixify will automatically add missing targets to the toolchain.

Cross-compilation

aarch64-darwin aarch64-linux x86_64-darwin x86_64-linux
aarch64-apple-darwin ✔️ ✔️ ✔️ ✔️
aarch64-unknown-linux-gnu ✔️ ✔️ ✔️ ✔️
aarch64-unknown-linux-musl ✔️ ✔️ ✔️ ✔️
aarch64-linux-android ✔️
arm-unknown-linux-gnueabihf ✔️ ✔️ ✔️ ✔️
arm-unknown-linux-musleabihf ✔️ ✔️ ✔️ ✔️
armv7-unknown-linux-gnueabihf ✔️ ✔️ ✔️ ✔️
armv7-unknown-linux-musleabihf ✔️ ✔️ ✔️ ✔️
powerpc64le-unknown-linux-gnu ✔️ ✔️ ✔️ ✔️
riscv64gc-unknown-linux-gnu ✔️ ✔️ ✔️ ✔️
s390x-unknown-linux-gnu ✔️ ✔️ ✔️ ✔️
wasm32-unknown-unknown ✔️ ✔️ ✔️ ✔️
wasm32-wasi ✔️ ✔️ ✔️ ✔️
x86_64-apple-darwin ✔️ ✔️ ✔️ ✔️
x86_64-pc-windows-gnu ✔️ ✔️ ✔️ ✔️
x86_64-unknown-linux-gnu ✔️ ✔️ ✔️ ✔️
x86_64-unknown-linux-musl ✔️ ✔️ ✔️ ✔️

Template

To nixify a Rust project:

nix flake init --template 'github:rvolosatovs/nixify#rust'

Examples

A flake definition at examples/rust-hello/flake.nix:

{
  inputs.nixify.url = github:rvolosatovs/nixify;

  outputs = {nixify, ...}:
    nixify.lib.rust.mkFlake {
      src = ./.;
    };
}

Produces the following outputs:

$ nix flake show --no-write-lock-file 'github:rvolosatovs/nixify?dir=examples/rust-hello'
<...>
├───apps
│   ├───aarch64-darwin
│   │   ├───default: app
│   │   ├───rust-hello: app
│   │   └───rust-hello-debug: app
│   ├───aarch64-linux
│   │   ├───default: app
│   │   ├───rust-hello: app
│   │   └───rust-hello-debug: app
│   ├───x86_64-darwin
│   │   ├───default: app
│   │   ├───rust-hello: app
│   │   └───rust-hello-debug: app
│   └───x86_64-linux
│       ├───default: app
│       ├───rust-hello: app
│       └───rust-hello-debug: app
├───checks
│   ├───aarch64-darwin
│   │   ├───audit: derivation 'rust-hello-audit-0.1.0'
│   │   ├───clippy: derivation 'rust-hello-clippy-0.1.0'
│   │   ├───doc: derivation 'rust-hello-doc-0.1.0'
│   │   ├───fmt: derivation 'rust-hello-fmt-0.1.0'
│   │   └───nextest: derivation 'rust-hello-nextest-0.1.0'
│   ├───aarch64-linux
│   │   ├───audit: derivation 'rust-hello-audit-0.1.0'
│   │   ├───clippy: derivation 'rust-hello-clippy-0.1.0'
│   │   ├───doc: derivation 'rust-hello-doc-0.1.0'
│   │   ├───fmt: derivation 'rust-hello-fmt-0.1.0'
│   │   └───nextest: derivation 'rust-hello-nextest-0.1.0'
│   ├───x86_64-darwin
│   │   ├───audit: derivation 'rust-hello-audit-0.1.0'
│   │   ├───clippy: derivation 'rust-hello-clippy-0.1.0'
│   │   ├───doc: derivation 'rust-hello-doc-0.1.0'
│   │   ├───fmt: derivation 'rust-hello-fmt-0.1.0'
│   │   └───nextest: derivation 'rust-hello-nextest-0.1.0'
│   └───x86_64-linux
│       ├───audit: derivation 'rust-hello-audit-0.1.0'
│       ├───clippy: derivation 'rust-hello-clippy-0.1.0'
│       ├───doc: derivation 'rust-hello-doc-0.1.0'
│       ├───fmt: derivation 'rust-hello-fmt-0.1.0'
│       └───nextest: derivation 'rust-hello-nextest-0.1.0'
├───devShells
│   ├───aarch64-darwin
│   │   └───default: development environment 'nix-shell'
│   ├───aarch64-linux
│   │   └───default: development environment 'nix-shell'
│   ├───x86_64-darwin
│   │   └───default: development environment 'nix-shell'
│   └───x86_64-linux
│       └───default: development environment 'nix-shell'
├───formatter
│   ├───aarch64-darwin: package 'alejandra-3.0.0'
│   ├───aarch64-linux: package 'alejandra-3.0.0'
│   ├───x86_64-darwin: package 'alejandra-3.0.0'
│   └───x86_64-linux: package 'alejandra-3.0.0'
├───overlays
│   ├───default: Nixpkgs overlay
│   ├───fenix: Nixpkgs overlay
│   ├───rust-hello: Nixpkgs overlay
│   └───rust-overlay: Nixpkgs overlay
└───packages
    ├───aarch64-darwin
    │   ├───build-rust-hello-oci: package 'build-rust-hello-oci'
    │   ├───default: package 'rust-hello-0.1.0'
    │   ├───rust-hello: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-aarch64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-aarch64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-aarch64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-armv7-unknown-linux-musleabihf: package 'rust-hello-0.1.0'
    │   ├───rust-hello-armv7-unknown-linux-musleabihf-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-armv7-unknown-linux-musleabihf-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-aarch64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-aarch64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-aarch64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-armv7-unknown-linux-musleabihf: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-armv7-unknown-linux-musleabihf-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-armv7-unknown-linux-musleabihf-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-wasm32-unknown-unknown: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-wasm32-unknown-unknown-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-wasm32-unknown-unknown-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-wasm32-wasi: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-wasm32-wasi-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-wasm32-wasi-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-pc-windows-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-pc-windows-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-pc-windows-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-wasm32-unknown-unknown: package 'rust-hello-0.1.0'
    │   ├───rust-hello-wasm32-unknown-unknown-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-wasm32-unknown-unknown-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-wasm32-wasi: package 'rust-hello-0.1.0'
    │   ├───rust-hello-wasm32-wasi-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-wasm32-wasi-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-x86_64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-pc-windows-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-pc-windows-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-x86_64-pc-windows-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-x86_64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   └───rust-hello-x86_64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    ├───aarch64-linux
    │   ├───build-rust-hello-oci: package 'build-rust-hello-oci'
    │   ├───default: package 'rust-hello-0.1.0'
    │   ├───rust-hello: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-aarch64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-aarch64-linux-android: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-linux-android-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-aarch64-linux-android-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-aarch64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-aarch64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-armv7-unknown-linux-musleabihf: package 'rust-hello-0.1.0'
    │   ├───rust-hello-armv7-unknown-linux-musleabihf-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-armv7-unknown-linux-musleabihf-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-aarch64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-aarch64-linux-android: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-linux-android-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-aarch64-linux-android-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-aarch64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-aarch64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-armv7-unknown-linux-musleabihf: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-armv7-unknown-linux-musleabihf-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-armv7-unknown-linux-musleabihf-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-wasm32-unknown-unknown: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-wasm32-unknown-unknown-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-wasm32-unknown-unknown-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-wasm32-wasi: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-wasm32-wasi-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-wasm32-wasi-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-pc-windows-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-pc-windows-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-pc-windows-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-wasm32-unknown-unknown: package 'rust-hello-0.1.0'
    │   ├───rust-hello-wasm32-unknown-unknown-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-wasm32-unknown-unknown-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-wasm32-wasi: package 'rust-hello-0.1.0'
    │   ├───rust-hello-wasm32-wasi-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-wasm32-wasi-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-x86_64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-pc-windows-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-pc-windows-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-x86_64-pc-windows-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-x86_64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   └───rust-hello-x86_64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    ├───x86_64-darwin
    │   ├───build-rust-hello-oci: package 'build-rust-hello-oci'
    │   ├───default: package 'rust-hello-0.1.0'
    │   ├───rust-hello: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-aarch64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-aarch64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-aarch64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-aarch64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-armv7-unknown-linux-musleabihf: package 'rust-hello-0.1.0'
    │   ├───rust-hello-armv7-unknown-linux-musleabihf-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-armv7-unknown-linux-musleabihf-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-aarch64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-aarch64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-aarch64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-aarch64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-armv7-unknown-linux-musleabihf: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-armv7-unknown-linux-musleabihf-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-armv7-unknown-linux-musleabihf-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-wasm32-unknown-unknown: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-wasm32-unknown-unknown-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-wasm32-unknown-unknown-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-wasm32-wasi: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-wasm32-wasi-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-wasm32-wasi-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-pc-windows-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-pc-windows-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-pc-windows-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-debug-x86_64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-debug-x86_64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-wasm32-unknown-unknown: package 'rust-hello-0.1.0'
    │   ├───rust-hello-wasm32-unknown-unknown-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-wasm32-unknown-unknown-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-wasm32-wasi: package 'rust-hello-0.1.0'
    │   ├───rust-hello-wasm32-wasi-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-wasm32-wasi-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-apple-darwin: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-x86_64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-pc-windows-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-pc-windows-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-x86_64-pc-windows-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-unknown-linux-gnu: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
    │   ├───rust-hello-x86_64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
    │   ├───rust-hello-x86_64-unknown-linux-musl: package 'rust-hello-0.1.0'
    │   ├───rust-hello-x86_64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
    │   └───rust-hello-x86_64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
    └───x86_64-linux
        ├───build-rust-hello-oci: package 'build-rust-hello-oci'
        ├───default: package 'rust-hello-0.1.0'
        ├───rust-hello: package 'rust-hello-0.1.0'
        ├───rust-hello-aarch64-apple-darwin: package 'rust-hello-0.1.0'
        ├───rust-hello-aarch64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-aarch64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-aarch64-linux-android: package 'rust-hello-0.1.0'
        ├───rust-hello-aarch64-linux-android-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-aarch64-linux-android-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-aarch64-unknown-linux-gnu: package 'rust-hello-0.1.0'
        ├───rust-hello-aarch64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-aarch64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-aarch64-unknown-linux-musl: package 'rust-hello-0.1.0'
        ├───rust-hello-aarch64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-aarch64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-armv7-unknown-linux-musleabihf: package 'rust-hello-0.1.0'
        ├───rust-hello-armv7-unknown-linux-musleabihf-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-armv7-unknown-linux-musleabihf-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-aarch64-apple-darwin: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-aarch64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-aarch64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug-aarch64-linux-android: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-aarch64-linux-android-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-aarch64-linux-android-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug-aarch64-unknown-linux-gnu: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-aarch64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-aarch64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug-aarch64-unknown-linux-musl: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-aarch64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-aarch64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug-armv7-unknown-linux-musleabihf: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-armv7-unknown-linux-musleabihf-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-armv7-unknown-linux-musleabihf-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug-wasm32-unknown-unknown: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-wasm32-unknown-unknown-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-wasm32-unknown-unknown-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug-wasm32-wasi: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-wasm32-wasi-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-wasm32-wasi-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug-x86_64-apple-darwin: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-x86_64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-x86_64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug-x86_64-pc-windows-gnu: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-x86_64-pc-windows-gnu-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-x86_64-pc-windows-gnu-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug-x86_64-unknown-linux-gnu: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-x86_64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-x86_64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-debug-x86_64-unknown-linux-musl: package 'rust-hello-0.1.0'
        ├───rust-hello-debug-x86_64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-debug-x86_64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-wasm32-unknown-unknown: package 'rust-hello-0.1.0'
        ├───rust-hello-wasm32-unknown-unknown-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-wasm32-unknown-unknown-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-wasm32-wasi: package 'rust-hello-0.1.0'
        ├───rust-hello-wasm32-wasi-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-wasm32-wasi-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-x86_64-apple-darwin: package 'rust-hello-0.1.0'
        ├───rust-hello-x86_64-apple-darwin-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-x86_64-apple-darwin-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-x86_64-pc-windows-gnu: package 'rust-hello-0.1.0'
        ├───rust-hello-x86_64-pc-windows-gnu-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-x86_64-pc-windows-gnu-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-x86_64-unknown-linux-gnu: package 'rust-hello-0.1.0'
        ├───rust-hello-x86_64-unknown-linux-gnu-deps: package 'rust-hello-deps-0.1.0'
        ├───rust-hello-x86_64-unknown-linux-gnu-oci: package 'docker-image-rust-hello.tar.gz'
        ├───rust-hello-x86_64-unknown-linux-musl: package 'rust-hello-0.1.0'
        ├───rust-hello-x86_64-unknown-linux-musl-deps: package 'rust-hello-deps-0.1.0'
        └───rust-hello-x86_64-unknown-linux-musl-oci: package 'docker-image-rust-hello.tar.gz'

Motivation

For a brief overview of motivation of this project to exist, see this talk at FOSDEM'23: https://archive.fosdem.org/2023/schedule/event/nix_and_nixos_a_success_story/

nixify's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar rvolosatovs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

enarx

nixify's Issues

Update README

Documentation is outdated, many things mentioned are not actually required

generate an `app` per Rust workspace binary

$ nix run 'github:rvolosatovs/nixify?dir=examples/rust-hello-multibin'
[...]

error: unable to execute '/nix/store/gm2sj4fii5pfyj0ghlfs5h2d5adg4bkx-rust-hello-multibin-0.1.0/bin/rust-hello-multibin': No such file or directory

How compile for android

This is a continuation from this issue

I have a repo here:

https://github.com/mamcx/RustStoreNix/tree/nixify

I must compile on macOS, Linux with targets windows, linux musl, android, ios. But my major problem is with android. I need:

def archTriplets = [
        'armeabi-v7a': 'armv7-linux-androideabi',
        'arm64-v8a'  : 'aarch64-linux-android',
]

I tried with:

❯ nix --version
nix (Nix) 2.18.1
{
  inputs.nixify.url = github:rvolosatovs/nixify;

  outputs = {nixify, ...}:
    nixify.lib.rust.mkFlake {
      src = ./.;
      name = "rust-workspace";

      build.workspace = true;
      clippy.workspace = true;
      test.workspace = true;
    };
}

And get :

❯ nix develop
warning: Git tree '/Users/mamcx/Proyectos/Apps' is dirty
(nix:nix-shell-env) bash-5.2$ cargo build
+ command cargo build
   Compiling ring v0.17.6
   Compiling zstd-sys v2.0.9+zstd.1.5.5
   Compiling generic-array v0.14.7
   Compiling globset v0.4.14
   Compiling rustix v0.38.26
   Compiling pin-project v1.1.3
   Compiling walkdir v2.4.0
   Compiling libsqlite3-sys v0.27.0
   Compiling tracing-subscriber v0.3.18
   Compiling thiserror v1.0.50
   Compiling phf_codegen v0.11.2
   Compiling phf v0.11.2
   Compiling parse-zoneinfo v0.3.0
error: linking with `cc` failed: exit status: 1

[Feature]: [Rust] Provide target builds regardless of `targets`

Is there an existing issue for this?

  • I have searched the existing issues

Description

Rather than generating target-specific outputs based upon targets in rust-toolchain.toml, use a custom toolchain per-target and provide builds for various targets out-of-the-box

Acceptance Criteria

No response

Suggestions for a technical implementation

merge the rust-toolchain.toml toolchain with additional target per-output

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.