Skip to content

Commit

Permalink
Add Nix shell
Browse files Browse the repository at this point in the history
Signed-off-by: kosumi <[email protected]>
  • Loading branch information
KaminariOS committed Oct 12, 2023
1 parent 58c42c5 commit ea7a7e4
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#use_flake_if_supported
use flake
# eval "$shellHook"
130 changes: 130 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
description = "Risinglight";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { nixpkgs, flake-utils, rust-overlay,... }: let
lib = {
inherit (flake-utils.lib) defaultSystems eachSystem;
};
supportedSystems = [ "x86_64-linux" ];
in lib.eachSystem supportedSystems (system: let

pkgs = import nixpkgs {
inherit system;
overlays = [
(import rust-overlay)
];
};
pinnedRust = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain).override {
extensions = ["rustc-dev" "rust-src" "rust-analyzer-preview" ];
targets = [ "x86_64-unknown-linux-gnu" ];
};
rustPlatform = pkgs.makeRustPlatform {
rustc = pinnedRust;
cargo = pinnedRust;
};
in {

devShell = pkgs.mkShell {
hardeningDisable = [
"fortify"
];
nativeBuildInputs = [
pinnedRust
pkgs.protobuf
];
buildInputs = [
];

shellHook = ''
'';
};

});
}

0 comments on commit ea7a7e4

Please sign in to comment.