Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0xmovses/flake #112

Merged
merged 3 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 1 addition & 32 deletions m1/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,2 @@
[alias]
xclippy = [
"clippy",
"--workspace",
"--all-targets",
"--",
"-Dwarnings",
"-Wclippy::all",
"-Aclippy::upper_case_acronyms",
"-Aclippy::enum-variant-names",
"-Aclippy::result-large-err",
"-Aclippy::mutable-key-type",
]

[build]
rustflags = ["--cfg", "tokio_unstable", "-C", "force-frame-pointers=yes", "-C", "force-unwind-tables=yes"]

# TODO(grao): Figure out whether we should enable other cpu features, and whether we should use a different way to configure them rather than list every single one here.
[target.x86_64-unknown-linux-gnu]
rustflags = ["--cfg", "tokio_unstable", "-C", "link-arg=-fuse-ld=lld", "-C", "force-frame-pointers=yes", "-C", "force-unwind-tables=yes", "-C", "target-feature=+sse4.2"]

# 64 bit MSVC
[target.x86_64-pc-windows-msvc]
rustflags = [
"--cfg",
"tokio_unstable",
"-C",
"force-frame-pointers=yes",
"-C",
"force-unwind-tables=yes",
"-C",
"link-arg=/STACK:8000000" # Set stack to 8 MB
]
rustflags = ["--cfg", "tokio_unstable"]
130 changes: 130 additions & 0 deletions m1/flake.lock

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

56 changes: 56 additions & 0 deletions m1/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
description = "A devShell example";

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

outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
darwinFrameworks = if system == "x86_64-darwin" then with pkgs.darwin.apple_sdk.frameworks; [
IOKit
SystemConfiguration
AppKit
] else [];
in
with pkgs;
{
devShells.default = mkShell {
buildInputs = [
pkgs.clang_14
zlib
bzip2
lz4
snappy
zstd
rocksdb
openssl
pkg-config
eza
fd
rust-bin.beta.latest.default
] ++ darwinFrameworks;

shellHook = ''
alias ls=eza
alias find=fd

echo "> Entered Nix-powered M1 simulator environment"
export OLD_PS1="$PS1"
PS1="(M1-nix) $PS1"

# Set MACOSX_DEPLOYMENT_TARGET for compatibility
export MACOSX_DEPLOYMENT_TARGET="10.13"
echo "MACOSX_DEPLOYMENT_TARGET set to: $MACOSX_DEPLOYMENT_TARGET"
'';
};
}
);
}
35 changes: 0 additions & 35 deletions m1/scripts/default.nix

This file was deleted.

1 change: 0 additions & 1 deletion m1/scripts/rust-toolchain

This file was deleted.

5 changes: 1 addition & 4 deletions m1/scripts/simulator.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash

# Dummy function placeholders for actual commands that would be implemented
# run nix develop then call this script

init_env() {
echo "Initializing Environment"
Expand Down
Loading