From 43302fc3086cfced7bf4d93a493fc1edc04d9ca8 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sun, 19 Apr 2020 14:36:59 -0700 Subject: Basic use of nix-shell with direnv/lorri --- .envrc | 17 +++++++---------- shell.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 shell.nix diff --git a/.envrc b/.envrc index 9b59534..6934f24 100644 --- a/.envrc +++ b/.envrc @@ -1,11 +1,8 @@ -# idk if these work -export GUILE_LOAD_PATH=$PWD -export NIX_PATH=$PWD:$NIX_PATH - -# tooling for bild/repl/push scripts -export PATH=$PWD:$PATH +PATH_add $PWD export BIZ_ROOT=$PWD - -# defaults for doing dev stuff -export HERO_PORT=3000 -export HERO_CLIENT=$PWD/_bild/Com.MusicMeetsComics.Client/static +if type lorri &>/dev/null +then + eval "$(lorri direnv)" +else + use nix +fi diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..8fe59f8 --- /dev/null +++ b/shell.nix @@ -0,0 +1,28 @@ +{ + isDevelopmentShell ? true +}: + +let + nixpkgs-tar = builtins.fetchTarball (import ./nixpkgs.nix); + nixpkgs = import "${nixpkgs-tar}" { overlays = [ (import ./overlay.nix) ]; }; + nixos = import "${nixpkgs-tar}/nixos"; + biz = import ./biz.nix { inherit nixpkgs; }; +in nixpkgs.mkShell ({ + name = "bizdev"; + buildInputs = [ + nixpkgs.git + nixpkgs.hlint + nixpkgs.niv + nixpkgs.ormolu + nixpkgs.python37Packages.black + nixpkgs.python37Packages.pylint + nixpkgs.wemux + ]; + shellHook = '' + export HERO_PORT=3000 + # TODO: figure out another way to do this + #export HERO_CLIENT=$PWD/_bild/Com.MusicMeetsComics.Client/static + + echo "biz" | ${nixpkgs.figlet}/bin/figlet | ${nixpkgs.lolcat}/bin/lolcat + ''; +}) -- cgit v1.2.3