-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
62 lines (58 loc) · 1.88 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
# This file is pretty general, and you can adapt it in your project replacing
# only `name` and `description` below.
{
description = "Yet another Game Boy emulator in rust";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, utils, rust-overlay, ... }:
let
# If you change the name here, you must also do it in Cargo.toml
name = "rusty-feed-reader";
rustChannel = "stable";
in
utils.lib.eachDefaultSystem
(system:
let
# Imports
pkgs = import nixpkgs {
inherit system;
overlays = [
rust-overlay.overlay
(self: super: {
rustc = self.rust-bin.${rustChannel}.latest.default;
cargo = self.rust-bin.${rustChannel}.latest.default;
rustfmt = self.rust-bin.${rustChannel}.latest.default;
})
];
};
# Configuration for the non-Rust dependencies
buildInputs = with pkgs; [ openssl.dev SDL2 ];
nativeBuildInputs = with pkgs; [ rustc cargo pkgconfig ];
in
rec {
# `nix develop`
devShell = pkgs.mkShell
{
buildInputs = buildInputs ++ (with pkgs;
# Tools you need for development go here.
[
pkgs.cargo
pkgs.rustc
pkgs.rustfmt
nixpkgs-fmt
cargo-watch
cargo-outdated
cargo-edit
]);
RUST_SRC_PATH = "${pkgs.rust-bin.${rustChannel}.latest.rust-src}/lib/rustlib/src/rust/library";
};
}
);
}