From c18cec94a13318dfbe9ca1d25186669bec40d6aa Mon Sep 17 00:00:00 2001 From: Campbell Alden Date: Tue, 11 Jul 2023 17:12:55 +0900 Subject: [PATCH] Add direnv and better support for Darwin --- .envrc | 9 +++++++++ shell.nix | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 .envrc create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..82b2b9e --- /dev/null +++ b/.envrc @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# the shebang is ignored, but nice for editors + +if type -P lorri &>/dev/null; then + eval "$(lorri direnv)" +else + echo 'while direnv evaluated .envrc, could not find the command "lorri" [https://github.com/nix-community/lorri]' + use nix +fi diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..157b677 --- /dev/null +++ b/shell.nix @@ -0,0 +1,8 @@ +{ pkgs ? import {} }: + +pkgs.mkShell { + buildInputs = [ + pkgs.rustc + pkgs.cargo + ] ++ [ pkgs.libiconv pkgs.darwin.apple_sdk.frameworks.CoreServices ]; +}