From d10af1aafa74b6a1a0784ce396c4b11b5e588f0a Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Tue, 5 Oct 2021 18:21:42 +0100 Subject: [PATCH] flake: Add nix flake and envrc for developers This adds a flake.nix and direnv's envrc for developing rustup on a NixOS host. This is explicitly *NOT* for constructing rustup for NixOS users. Signed-off-by: Daniel Silverstone --- .envrc | 1 + .gitignore | 1 + flake.nix | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 .envrc create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000000..3550a30f2d --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 08107a6644..eb4221f2ac 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /home /local-rustup /snapcraft +flake.lock diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000..a4cfbec25b --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +# This is a cheap nix flake for direnv use for developing +# Rustup if you are running on NixOS. +# +# We deliberately don't commit a flake.lock because we only +# provide this for developers, not as a way to have rustup +# built for NixOS. + +{ + inputs = { flake-utils.url = "github:numtide/flake-utils"; }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + stdenv + openssl + pkg-config + ]; + }; + }); +}