-
Notifications
You must be signed in to change notification settings - Fork 18
/
flake.nix
84 lines (76 loc) · 2.53 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
description = "Flake providing a development shell for MnemOS";
inputs = {
# unstable is necessary for Oranda's flake, which depends on `tailwindcss`
# (not available in stable nixpkgs yet).
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
oranda = {
url = "github:axodotdev/oranda";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
# see https://fasterthanli.me/series/building-a-rust-service-with-nix/part-10#a-flake-with-a-dev-shell
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = { self, nixpkgs, flake-utils, oranda, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
# use the Rust toolchain specified in the project's rust-toolchain.toml
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile
./rust-toolchain.toml;
in
{
devShell = with pkgs;
mkShell rec {
name = "mnemos-dev";
nativeBuildInputs = [
# needed for building C deps such as SDL2 for embedded-graphics
# simulator.
pkg-config
cmake
# compilers
rustToolchain
clang
# devtools
just
cargo-nextest
# rust esp32 tools
cargo-espflash
cargo-espmonitor
# for testing the x86_64 kernel
qemu
# for building the website
oranda.packages.${system}.default
python3 # needed by rfc2book
# for building pomelo
trunk
];
buildInputs = [
libclang
zlib
# dependencies of the host tools
# TODO(eliza): add separate packages for each of crowtty,
# melpomene, and other host tools...
systemd
udev.dev
SDL2
SDL2.dev
];
# Fix missing OpenSSL
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}";
};
});
}