From 09233e1e9914bd6de0a147985c82412969d31a17 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Fri, 1 Jan 2021 19:04:22 +0100 Subject: [PATCH] init --- .envrc | 1 + .gitignore | 1 + Cargo.toml | 9 +++++++++ shell.nix | 27 +++++++++++++++++++++++++++ src/main.rs | 3 +++ 5 files changed, 41 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 shell.nix create mode 100644 src/main.rs diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..4a4726a --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use_nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..bae83bd --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "Mercury" +version = "0.1.0" +authors = ["Daniel Olsen "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..8b349a6 --- /dev/null +++ b/shell.nix @@ -0,0 +1,27 @@ +let + moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); + nixpkgs = import { overlays = [ moz_overlay ]; }; + rustNightlyChannel = (nixpkgs.rustChannelOf { date = "2020-03-19"; channel = "nightly"; }).rust.override { + extensions = [ + "rust-src" + "rls-preview" + "clippy-preview" + "rustfmt-preview" + ]; + }; + rustStableChannel = nixpkgs.latest.rustChannels.stable.rust.override { + extensions = [ + "rust-src" + "rls-preview" + "clippy-preview" + "rustfmt-preview" + ]; + }; +in +with nixpkgs; + stdenv.mkDerivation { + name = "moz_overlay_shell"; + buildInputs = [ + rustStableChannel + ]; + } diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}