wip
1{
2 description = "Flake to build and test the app";
3
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6 flake-utils.url = "github:numtide/flake-utils";
7 fenix = {
8 url = "github:nix-community/fenix";
9 inputs.nixpkgs.follows = "nixpkgs";
10 };
11 };
12
13 outputs = { self, nixpkgs, flake-utils, fenix, ... }:
14 flake-utils.lib.eachDefaultSystem (system:
15 let
16 pkgs = import nixpkgs { inherit system; config = { allowUnfree = true; };};
17
18 inherit (pkgs) lib;
19
20 toolchain = with fenix.packages.${system};
21 combine [
22 minimal.rustc
23 minimal.cargo
24 targets.riscv32imc-unknown-none-elf.latest.rust-std
25 ];
26
27 devShell = pkgs.mkShell rec {
28 buildInputs = with pkgs; [
29 pkg-config
30 udev
31 toolchain
32 ];
33
34 LD_LIBRARY_PATH = lib.concatStringsSep ":" (
35 builtins.map (input: "${input}/lib") buildInputs
36 );
37
38 };
39
40 in {
41 devShells = {
42 default = devShell;
43 };
44 }
45 );
46}