-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
57 lines (53 loc) · 1.55 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
{
description = "playdate-rust-template";
inputs = {
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
crank = {
url = "github:pd-rs/crank";
flake = false;
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs";
systems.url = "github:nix-systems/default";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
perSystem = { config, inputs', pkgs, system, ... }: {
_module.args.pkgs =
import inputs.nixpkgs {
localSystem = system;
overlays = [
(_: _: { crane = inputs.crane.lib.${system}; })
inputs.fenix.overlays.default
(final: prev: {
crank = final.crane.buildPackage {
src = inputs.crank;
buildInputs = final.lib.optionals final.stdenv.isDarwin [
final.libiconv
];
};
})
];
};
devShells.default = pkgs.mkShell {
packages = [
pkgs.crank
pkgs.fenix.latest.cargo
pkgs.fenix.latest.clippy
pkgs.fenix.latest.rustc
pkgs.fenix.latest.rustfmt
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.gcc-arm-embedded
];
};
};
};
}