{"id":13688014,"url":"https://github.com/srid/rust-nix-template","last_synced_at":"2025-04-13T02:19:39.214Z","repository":{"id":40438583,"uuid":"355275281","full_name":"srid/rust-nix-template","owner":"srid","description":"Rust project template with Nix (Flakes) and VSCode support","archived":false,"fork":false,"pushed_at":"2024-10-17T13:27:25.000Z","size":114,"stargazers_count":206,"open_issues_count":3,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T18:54:56.683Z","etag":null,"topics":["nix","rust","template-project","vscode"],"latest_commit_sha":null,"homepage":"https://srid.ca/rust-nix","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/srid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-06T17:28:17.000Z","updated_at":"2024-10-17T22:13:31.000Z","dependencies_parsed_at":"2023-01-19T03:45:15.935Z","dependency_job_id":"5b7e73fb-eae8-4ee0-997d-442eac233df9","html_url":"https://github.com/srid/rust-nix-template","commit_stats":null,"previous_names":[],"tags_count":4,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srid%2Frust-nix-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srid%2Frust-nix-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srid%2Frust-nix-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srid%2Frust-nix-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srid","download_url":"https://codeload.github.com/srid/rust-nix-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654380,"owners_count":21140287,"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":["nix","rust","template-project","vscode"],"created_at":"2024-08-02T15:01:05.006Z","updated_at":"2025-04-13T02:19:39.180Z","avatar_url":"https://github.com/srid.png","language":"Nix","funding_links":[],"categories":["Nix"],"sub_categories":[],"readme":"A template Rust project with fully functional and no-frills Nix support, as well as builtin VSCode configuration to get IDE experience without any manual setup (just [install direnv](https://nixos.asia/en/direnv), open in VSCode and accept the suggestions). It uses [crane](https://crane.dev/), via [rust-flake](https://github.com/juspay/rust-flake).\n\n\u003e [!NOTE]\n\u003e If you are looking for the original template based on [this blog post](https://srid.ca/rust-nix)'s use of `crate2nix`, browse from [this tag](https://github.com/srid/rust-nix-template/tree/crate2nix). The evolution of this template can be gleaned from [releases](https://github.com/srid/rust-nix-template/releases).\n\n## Usage\n\nYou can use [omnix](https://omnix.page/om/init.html)[^omnix] to initialize this template:\n```\nnix --accept-flake-config run github:juspay/omnix -- init github:srid/rust-nix-template -o ~/my-rust-project\n```\n\n[^omnix]: If initializing manually, make sure to:\n    - Change `name` in Cargo.toml.\n    - Run `cargo generate-lockfile` in the nix shelld\n\n## Adapting this template\n\n- There are two CI workflows, and one of them uses Nix which is slower (unless you configure a cache) than the other one based on rustup. Pick one or the other depending on your trade-offs.\n\n## Development (Flakes)\n\nThis repo uses [Flakes](https://nixos.asia/en/flakes) from the get-go.\n\n```bash\n# Dev shell\nnix develop\n\n# or run via cargo\nnix develop -c cargo run\n\n# build\nnix build\n```\n\nWe also provide a [`justfile`](https://just.systems/) for Makefile'esque commands to be run inside of the devShell.\n\n## Tips\n\n- Run `nix flake update` to update all flake inputs.\n- Run `nix --accept-flake-config run github:juspay/omnix ci` to build _all_ outputs.\n- [pre-commit] hooks will automatically be setup in Nix shell. You can also run `pre-commit run -a` manually to run the hooks (e.g.: to autoformat the project tree using `rustfmt`, `nixpkgs-fmt`, etc.).\n\n## Discussion\n\n- [Zulip](https://nixos.zulipchat.com/#narrow/stream/413950-nix)\n\n## See Also\n\n- [nixos.wiki: Packaging Rust projects with nix](https://nixos.wiki/wiki/Rust#Packaging_Rust_projects_with_nix)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrid%2Frust-nix-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrid%2Frust-nix-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrid%2Frust-nix-template/lists"}