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 <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone
2021-10-05 18:21:42 +01:00
parent 59de864bc9
commit d10af1aafa
3 changed files with 25 additions and 0 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@
/home
/local-rustup
/snapcraft
flake.lock

23
flake.nix Normal file
View File

@@ -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
];
};
});
}