-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add basic nix-shell stuff (#103)
This basically just makes sure you have QEMU and rustup. It would be nice to also get it to install all the required cargo install tools automagically, but I'll mess with that later. Just installing rustup should ensure that the required rustup components are present, since they're specified in the toolchain file. Maybe there is also a more nix-y way to do that part, but I dgaf.
- Loading branch information
Showing
3 changed files
with
52 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 @@ | ||
use 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,32 @@ | ||
scope@{ pkgs ? import <nixpkgs> { } }: | ||
|
||
pkgs.buildEnv { | ||
name = "mycelium-kernel-env"; | ||
paths = with pkgs; | ||
[ | ||
git | ||
bash | ||
direnv | ||
binutils | ||
stdenv | ||
bashInteractive | ||
cacert | ||
gcc | ||
cmake | ||
rustup | ||
pkg-config | ||
openssl | ||
(glibcLocales.override { locales = [ "en_US.UTF-8" ]; }) | ||
] ++ lib.optional stdenv.isDarwin [ Security libiconv ]; | ||
passthru = with pkgs; { | ||
LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; | ||
LC_ALL = "en_US.UTF-8"; | ||
OPENSSL_DIR = "${openssl.dev}"; | ||
OPENSSL_LIB_DIR = "${openssl.out}/lib"; | ||
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; | ||
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt"; | ||
CURL_CA_BUNDLE = "${cacert}/etc/ca-bundle.crt"; | ||
CARGO_TERM_COLOR = "always"; | ||
RUST_BACKTRACE = "full"; | ||
}; | ||
} |
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,19 @@ | ||
scope@{ pkgs ? import <nixpkgs> { } }: | ||
|
||
let env = (import ./default.nix scope); | ||
|
||
in pkgs.mkShell { | ||
# also install qemu into the dev shell, for testing | ||
packages = [ pkgs.qemu_full ]; | ||
|
||
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"; | ||
LC_ALL = "en_US.UTF-8"; | ||
OPENSSL_DIR = "${pkgs.openssl.dev}"; | ||
OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib"; | ||
SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; | ||
GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; | ||
CURL_CA_BUNDLE = "${pkgs.cacert}/etc/ca-bundle.crt"; | ||
CARGO_TERM_COLOR = "always"; | ||
RUST_BACKTRACE = "1"; | ||
buildInputs = [ (import ./default.nix { inherit pkgs; }) ]; | ||
} |