Skip to content

Commit

Permalink
build docs, meson minimum version, flake update
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Jun 24, 2024
1 parent 962e67b commit d2c9961
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 12 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,35 @@ You can very easily end up with a bricked device if the written firmware can't j
| [NuPhy Air60 v1](https://nuphy.com/products/air60) | SH68F90A / BYK916 ||| TBD | [Details](docs/keyboards/nuphy-air60.md) |
| E-YOOSO Z11 | SH68F90A / BYK901 ||| N/A | [Details](docs/keyboards/nuphy-air60.md) |

## Developing

### Prerequisites

#### Nix

Currently, this project is primarily developed with the help of [Nix](https://nixos.org/) and Nix flakes. Please consider using Nix and the provided [flake](https://github.com/carlossless/smk/blob/master/flake.nix) to automatically set up a reproducible development environment.

With Nix installed and flakes enabled, use `nix develop` or [direnv](https://direnv.net/) to enter a shell with all prerequisites installed.

#### Manual

If setting up prerequisites without nix, you will need the following tools installed and available within your environment:

* [sdcc](https://sdcc.sourceforge.net/) >= 4.3.0
* [meson](https://mesonbuild.com/) >= 0.53
* [ninja](https://ninja-build.org/) >= 1.11.1
* [sinowealth-kb-tool](https://github.com/carlossless/sinowealth-kb-tool) latest version - required only for flashing

### Building & Flashing

Once all prerequisites are set up, you can build and flash firmware for a specific combination of keyboard and layout using the following commands:

```sh
meson setup build # configure meson build dir
meson compile -C build nuphy-air60_default_smk.hex # build firmware for nuphy-air60 with the default layout
meson compile -C build nuphy-air60_default_flash # write firmware to the device via sinowealth-kb-tool
```

## Acknowledgements

* [libfx2](https://github.com/whitequark/libfx2)
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # for sdcc 4.4.0
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
utils.url = "github:numtide/flake-utils";
sinowealth-kb-tool.url = "github:carlossless/sinowealth-kb-tool";
};
Expand All @@ -17,14 +17,15 @@
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
sdcc
gnumake
binutils
clang-tools # for clang-format
sinowealth-kb-tool.packages."${system}".default
uhubctl
srecord
meson
ninja

sinowealth-kb-tool.packages."${system}".default # flashing
clang-tools # for clang-format

# useful supplementary tools
binutils # for objcopy
uhubctl
];
};
}
Expand Down
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
project(
'smk',
'c',
version: 'alpha'
version: 'alpha',
meson_version: '>=0.53.0'
)

fs = import('fs')
Expand Down

0 comments on commit d2c9961

Please sign in to comment.