Skip to content

Commit 02673cb

Browse files
committed
Shuffle the readme around
1 parent d3793fb commit 02673cb

File tree

2 files changed

+42
-50
lines changed

2 files changed

+42
-50
lines changed

README.md

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,15 @@
1-
# HWL
2-
[![CI](https://github.com/youngar/hwml-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/youngar/hwml-rs/actions/workflows/ci.yml)
3-
4-
HWL is an in-development hardware description language equiped with a powerful metaprogramming layer.
5-
6-
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).
7-
8-
> [!NOTE]
9-
> 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).
10-
11-
## Usage
12-
13-
You can use [omnix](https://omnix.page/om/init.html)[^omnix] to initialize this template:
14-
```
15-
nix --accept-flake-config run github:juspay/omnix -- init github:srid/hwml -o ~/my-rust-project
16-
```
17-
18-
[^omnix]: If initializing manually, make sure to:
19-
- Change `name` in Cargo.toml.
20-
- Run `cargo generate-lockfile` in the nix shelld
21-
22-
## Adapting this template
1+
# HWML
232

24-
- 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.
25-
26-
## Development (Flakes)
27-
28-
This repo uses [Flakes](https://nixos.asia/en/flakes) from the get-go.
29-
30-
```bash
31-
# Dev shell
32-
nix develop
3+
[![CI](https://github.com/youngar/hwml-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/youngar/hwml-rs/actions/workflows/ci.yml)
334

34-
# or run via cargo
35-
nix develop -c cargo run
5+
HWML is an in-development hardware description language equiped with a powerful metaprogramming layer.
366

37-
# build
38-
nix build
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
3912
```
4013

41-
We also provide a [`justfile`](https://just.systems/) for Makefile'esque commands to be run inside of the devShell.
42-
43-
## Tips
44-
45-
- Run `nix flake update` to update all flake inputs.
46-
- Run `nix --accept-flake-config run github:juspay/omnix ci` to build _all_ outputs.
47-
- [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.).
48-
49-
## Discussion
50-
51-
- [Zulip](https://nixos.zulipchat.com/#narrow/stream/413950-nix)
52-
53-
## See Also
54-
55-
- [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)