Skip to content

Commit 480b812

Browse files
authored
Merge pull request #1 from youngar/readme
Update the readme to mention the project name
2 parents bbdbd60 + 02673cb commit 480b812

File tree

2 files changed

+42
-45
lines changed

2 files changed

+42
-45
lines changed

README.md

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,15 @@
1-
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).
1+
# HWML
22

3-
> [!NOTE]
4-
> 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/hwml/tree/crate2nix). The evolution of this template can be gleaned from [releases](https://github.com/srid/hwml/releases).
3+
[![CI](https://github.com/youngar/hwml-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/youngar/hwml-rs/actions/workflows/ci.yml)
54

6-
## Usage
5+
HWML is an in-development hardware description language equiped with a powerful metaprogramming layer.
76

8-
You can use [omnix](https://omnix.page/om/init.html)[^omnix] to initialize this template:
7+
```hwml
8+
meta def option.map {a} {b} (f : ^a -> ^b)) (x : ^(option a)) : ^(option b) =
9+
match x with
10+
| some v => f v
11+
| none => none
912
```
10-
nix --accept-flake-config run github:juspay/omnix -- init github:srid/hwml -o ~/my-rust-project
11-
```
12-
13-
[^omnix]: If initializing manually, make sure to:
14-
- Change `name` in Cargo.toml.
15-
- Run `cargo generate-lockfile` in the nix shelld
16-
17-
## Adapting this template
18-
19-
- 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.
20-
21-
## Development (Flakes)
22-
23-
This repo uses [Flakes](https://nixos.asia/en/flakes) from the get-go.
24-
25-
```bash
26-
# Dev shell
27-
nix develop
28-
29-
# or run via cargo
30-
nix develop -c cargo run
31-
32-
# build
33-
nix build
34-
```
35-
36-
We also provide a [`justfile`](https://just.systems/) for Makefile'esque commands to be run inside of the devShell.
37-
38-
## Tips
39-
40-
- Run `nix flake update` to update all flake inputs.
41-
- Run `nix --accept-flake-config run github:juspay/omnix ci` to build _all_ outputs.
42-
- [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.).
43-
44-
## Discussion
45-
46-
- [Zulip](https://nixos.zulipchat.com/#narrow/stream/413950-nix)
47-
48-
## See Also
4913

50-
- [nixos.wiki: Packaging Rust projects with nix](https://nixos.wiki/wiki/Rust#Packaging_Rust_projects_with_nix)
14+
## Documentation
15+
- [Development](./doc/Development.md)

doc/Development.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Development
2+
3+
4+
## Getting Started with Nix
5+
6+
1) [install direnv](https://nixos.asia/en/direnv), open in VSCode and accept the suggestions.
7+
- It uses [crane](https://crane.dev/), via [rust-flake](https://github.com/juspay/rust-flake).
8+
9+
This repo uses [Flakes](https://nixos.asia/en/flakes).
10+
11+
```bash
12+
# Dev shell
13+
nix develop
14+
15+
# or run via cargo
16+
nix develop -c cargo run
17+
18+
# build
19+
nix build
20+
```
21+
22+
We also provide a [`justfile`](https://just.systems/) for Makefile'esque commands to be run inside of the devShell.
23+
24+
## Tips
25+
26+
- Run `nix flake update` to update all flake inputs.
27+
- Run `nix --accept-flake-config run github:juspay/omnix ci` to build _all_ outputs.
28+
- [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.).
29+
30+
## See Also
31+
32+
- [nixos.wiki: Packaging Rust projects with nix](https://nixos.wiki/wiki/Rust#Packaging_Rust_projects_with_nix)

0 commit comments

Comments
 (0)