-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f40d289
commit 2252f1e
Showing
6 changed files
with
270 additions
and
2 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 flake |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ data/ | |
tarpaulin-report.html | ||
lcov.info | ||
site | ||
.direnv/ |
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,103 @@ | ||
{ | ||
description = "Just a shell for now"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | ||
rust-overlay.url = "github:oxalica/rust-overlay"; | ||
rust-overlay.inputs.nixpkgs.follows = "nixpkgs"; | ||
devshell.url = "github:numtide/devshell"; | ||
devshell.inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
outputs = { | ||
self, | ||
nixpkgs, | ||
rust-overlay, | ||
devshell, | ||
}: let | ||
supportedSystems = ["x86_64-linux" "x86_64-darwin"]; | ||
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); | ||
nixpkgsFor = forAllSystems (system: | ||
import nixpkgs { | ||
inherit system; | ||
config.allowUnfree = true; | ||
overlays = [rust-overlay.overlays.default devshell.overlays.default]; | ||
}); | ||
in { | ||
devShell = forAllSystems ( | ||
system: let | ||
pkgs = nixpkgsFor."${system}"; | ||
rust-binaries = pkgs.rust-bin.stable.latest.default.override { | ||
extensions = ["rust-src"]; | ||
}; | ||
|
||
packages = with pkgs; | ||
[ | ||
rust-binaries | ||
llvmPackages_latest.clang | ||
llvmPackages_latest.lld | ||
cargo-udeps | ||
] | ||
++ lib.optionals stdenv.isDarwin [ | ||
libiconv | ||
darwin.apple_sdk.frameworks.Security | ||
darwin.apple_sdk.frameworks.CoreFoundation | ||
] ++ lib.optionals stdenv.isLinux [ | ||
pkg-config openssl | ||
]; | ||
in | ||
with pkgs; pkgs.devshell.mkShell | ||
{ | ||
imports = ["${devshell}/extra/language/rust.nix"]; | ||
language.rust.enableDefaultToolchain = false; | ||
inherit packages; | ||
env = [ | ||
{ | ||
name = "RUSTFLAGS"; | ||
eval = "\"-C link-arg=-fuse-ld=lld $RUSTFLAGS\""; | ||
} | ||
{ | ||
name = "RUSTDOCFLAGS"; | ||
eval = "\"-C link-arg=-fuse-ld=lld $RUSTDOCFLAGS\""; | ||
} | ||
{ | ||
name = "RUST_LOG"; | ||
value = "info"; | ||
} | ||
{ | ||
name = "OPENSSL_NO_VENDOR"; | ||
value = 1; | ||
} | ||
{ | ||
name = "OPENSSL_LIB_DIR"; | ||
value = "${lib.getLib openssl}/lib"; | ||
} | ||
{ | ||
name = "OPENSSL_INCLUDE_DIR"; | ||
value = "${lib.getDev openssl}/include"; | ||
} | ||
{ | ||
name = "LD_LIBRARY_PATH"; | ||
prefix = "${lib.getLib openssl}/lib"; | ||
} | ||
]; | ||
commands = [ | ||
{ | ||
name = "clippy"; | ||
category = "dev"; | ||
help = "Clippy checks accross all targets"; | ||
command = "cargo clippy --all --all-targets -- -Dwarnings -Drust-2018-idioms -Adeprecated"; | ||
} | ||
{ | ||
name = "dev"; | ||
category = "dev"; | ||
help = "Start the dev server"; | ||
command = '' | ||
cargo run | ||
''; | ||
} | ||
]; | ||
} | ||
); | ||
}; | ||
} |
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
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