Skip to content
This repository was archived by the owner on Aug 18, 2024. It is now read-only.

Commit 52704af

Browse files
committed
misc: add nix flake, toolchain config
1 parent 61399e0 commit 52704af

File tree

5 files changed

+138
-0
lines changed

5 files changed

+138
-0
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,6 @@ $RECYCLE.BIN/
8888

8989
# Windows shortcuts
9090
*.lnk
91+
92+
# Nix
93+
.direnv/

flake.lock

Lines changed: 94 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
description = "UTP TM4C Flake";
3+
4+
inputs = {
5+
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
6+
rust-overlay.url = github:oxalica/rust-overlay;
7+
flake-utils.url = github:numtide/flake-utils;
8+
};
9+
10+
# TODO: cargo extensions
11+
# TODO: CI setup? (garnix)
12+
# TODO: expose targets, etc.
13+
# TODO: flip-link, tests, etc.
14+
15+
# TODO: openocd, gdb-dashboard, etc.
16+
17+
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
18+
flake-utils.lib.eachDefaultSystem (system:
19+
let
20+
overlays = [ (import rust-overlay) ];
21+
pkgs = import nixpkgs {
22+
inherit system overlays;
23+
};
24+
in
25+
with pkgs;
26+
{
27+
devShells.default = mkShell {
28+
buildInputs = [
29+
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
30+
];
31+
shellHook = ''
32+
'';
33+
};
34+
}
35+
);
36+
}

rust-toolchain.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[toolchain]
2+
channel = "1.61.0"
3+
components = [ "rustc", "cargo", "rustfmt", "rust-std", "rust-docs", "rustc-dev", "clippy", "rust-src", "llvm-tools-preview" ]
4+
targets = [ "thumbv7em-none-eabihf" ]

0 commit comments

Comments
 (0)