-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flake-based direnv setup for nixOS users
- Loading branch information
Showing
5 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
NBS_ONLY_LOAD_ENV_VARS=1 source env.sh | ||
|
||
if command -v nix > /dev/null | ||
then | ||
export NIMBUS_NIX_ENV=1 | ||
|
||
cd nix | ||
# watch_file tells direnv that changes to any of the watched files | ||
# should trigger a re-evalution of the environment | ||
watch_file flake.nix | ||
watch_file flake.lock | ||
watch_file shell.nix | ||
|
||
mkdir -p .flake-profiles | ||
eval "$(nix print-dev-env --profile ".flake-profiles/profile")" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Local file unique for each user | ||
.flake-profiles/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
description = "nimbus-eth2"; | ||
|
||
inputs = { | ||
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11; | ||
flake-utils.url = github:numtide/flake-utils; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils }: | ||
flake-utils.lib.simpleFlake { | ||
inherit self nixpkgs; | ||
name = "nimbus-eth2"; | ||
shell = ./shell.nix; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{pkgs ? import <nixpkgs> {}}: | ||
with pkgs; | ||
mkShell { | ||
buildInputs = | ||
[ | ||
figlet | ||
git | ||
gnumake | ||
rocksdb | ||
] | ||
++ lib.optionals (!stdenv.isDarwin) [ | ||
lsb-release | ||
]; | ||
|
||
shellHook = '' | ||
# By default, the Nix wrapper scripts for executing the system compilers | ||
# will erase `-march=native` because this introduces impurity in the build. | ||
# For the purposes of compiling Nimbus, this behavior is not desired: | ||
export NIX_ENFORCE_NO_NATIVE=0 | ||
figlet "Welcome to Nimbus-eth1" | ||
''; | ||
} |