{"id":15677485,"url":"https://github.com/rpearce/nix-rust-template","last_synced_at":"2025-05-07T00:47:43.847Z","repository":{"id":43016418,"uuid":"427245476","full_name":"rpearce/nix-rust-template","owner":"rpearce","description":"A reasonable way to start developing a reproducible Rust project","archived":false,"fork":false,"pushed_at":"2022-03-23T02:43:20.000Z","size":9,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-07T00:47:26.395Z","etag":null,"topics":["docker","docker-compose","nix","nix-flakes","nix-template","rust","rust-lang","rust-template"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rpearce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"rpearce"}},"created_at":"2021-11-12T05:40:54.000Z","updated_at":"2023-11-10T10:46:35.000Z","dependencies_parsed_at":"2022-08-27T11:22:28.650Z","dependency_job_id":null,"html_url":"https://github.com/rpearce/nix-rust-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpearce%2Fnix-rust-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpearce%2Fnix-rust-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpearce%2Fnix-rust-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpearce%2Fnix-rust-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rpearce","download_url":"https://codeload.github.com/rpearce/nix-rust-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252793576,"owners_count":21805055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","nix","nix-flakes","nix-template","rust","rust-lang","rust-template"],"created_at":"2024-10-03T16:09:41.544Z","updated_at":"2025-05-07T00:47:43.813Z","avatar_url":"https://github.com/rpearce.png","language":"Nix","funding_links":["https://github.com/sponsors/rpearce"],"categories":[],"sub_categories":[],"readme":"# nix-rust-template\n\nA reasonable way to start developing a reproducible\n[Rust](https://www.rust-lang.org) project.\n\nThis reproducibility is enabled by [Nix](https://nixos.org) and\n[Docker](https://www.docker.com).\n\n## Features\n\nThis is a template repository; everything is customizable, and some helpful\ndefaults are included.\n\n* Default rust extensions:\n  * [`clippy-preview`](https://github.com/rust-lang/rust-clippy): A collection\n    of lints to catch common mistakes and improve your Rust code\n  * `rust-src`\n  * `rustc-dev`\n  * [`rustfmt`](https://github.com/rust-lang/rustfmt): A tool for formatting\n    Rust code according to style guidelines\n* Default dev tools:\n  * [`rust-analyzer`](https://github.com/rust-analyzer/rust-analyzer): Excellent\n    IDE support\n  * [`cargo-watch`](https://github.com/watchexec/cargo-watch): Watches over your\n    project's source for changes, and runs Cargo commands when they occur\n  * [`cargo-edit`](https://github.com/killercup/cargo-edit): Extends Cargo to\n    allow you to add, remove, and upgrade dependencies by modifying your\n    `Cargo.toml` file from the command line\n* [`naersk`](https://github.com/nix-community/naersk): Nix support for building\n  cargo crates\n* [`oxalica/rust-overlay`](https://github.com/oxalica/rust-overlay/): Pure and\n  reproducible overlay for binary distributed rust toolchains\n\n## Setup\n\n### With Docker\n\n#### With `docker compose` (recommended)\n\n```sh\ndocker compose build\ndocker compose up\n```\n\n#### Without `docker compose`\n\n```sh\ndocker build . -t nix-rust-template\ndocker volume create nix-rust-template-vol\ndocker run --rm -it -v $PWD:/service nix-rust-template:latest\n```\n\n### Without Docker\n\n1. [Install nix](https://nixos.org/download.html)\n1. [Install nix flakes](https://nixos.wiki/wiki/Flakes)\n\n## Commands\n\nIf you are using Docker, prefix the following with `docker compose run --rm\napp`; for example:\n\n```sh\ndocker compose run --rm app nix run .#watch\n```\n\n* `nix build`: build the package\n* `nix run` or `nix run .#app`: run the package\n* `nix run .#watch`: watch the package for changes and rerun\n* `nix develop`: enter a reproducible rust shell environment\n  * How to watch for changes and rerun:\n    ```sh\n    cargo watch -w \"./src/\" -x \"run\"\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpearce%2Fnix-rust-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frpearce%2Fnix-rust-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpearce%2Fnix-rust-template/lists"}