Skip to content

Commit 08567c4

Browse files
committed
Add Nix shell
1 parent 58c42c5 commit 08567c4

File tree

3 files changed

+182
-0
lines changed

3 files changed

+182
-0
lines changed

.envrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#use_flake_if_supported
2+
use flake
3+
# eval "$shellHook"

flake.lock

Lines changed: 130 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: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
description = "Risinglight";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
rust-overlay.url = "github:oxalica/rust-overlay";
7+
flake-utils.url = "github:numtide/flake-utils";
8+
};
9+
10+
outputs = { nixpkgs, flake-utils, rust-overlay,... }: let
11+
lib = {
12+
inherit (flake-utils.lib) defaultSystems eachSystem;
13+
};
14+
supportedSystems = [ "x86_64-linux" ];
15+
in lib.eachSystem supportedSystems (system: let
16+
17+
pkgs = import nixpkgs {
18+
inherit system;
19+
overlays = [
20+
(import rust-overlay)
21+
];
22+
};
23+
pinnedRust = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain).override {
24+
extensions = ["rustc-dev" "rust-src" "rust-analyzer-preview" ];
25+
targets = [ "x86_64-unknown-linux-gnu" ];
26+
};
27+
rustPlatform = pkgs.makeRustPlatform {
28+
rustc = pinnedRust;
29+
cargo = pinnedRust;
30+
};
31+
in {
32+
33+
devShell = pkgs.mkShell {
34+
hardeningDisable = [
35+
"fortify"
36+
];
37+
nativeBuildInputs = [
38+
pinnedRust
39+
pkgs.protobuf
40+
];
41+
buildInputs = [
42+
];
43+
44+
shellHook = ''
45+
'';
46+
};
47+
48+
});
49+
}

0 commit comments

Comments
 (0)