From 8f9de177e3cfed26cf9d67fd263d26ba85640eb2 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 30 Jul 2022 14:55:41 -0400 Subject: Initialize dev shell --- .envrc | 9 +++++++++ .gitignore | 1 + README | 13 +++++++++++++ shell.nix | 19 +++++++++++++++++++ start-repl.sh | 5 +++++ 5 files changed, 47 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 README create mode 100644 shell.nix create mode 100755 start-repl.sh diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..8cce2ff --- /dev/null +++ b/.envrc @@ -0,0 +1,9 @@ +# setup dev environment using direnv +# + if ! has nix_direnv_version || ! nix_direnv_version 1.5.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/1.5.1/direnvrc" "sha256-p4CDMJjuBmEh9pkn2aoJrZqr0DlPZHPU7eXOSDzzcuo=" + fi +# +# if direnv doesn't detect changes to the nix environment, just touch .envrc and +# it will refresh + use nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..29963da --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.direnv/ diff --git a/README b/README new file mode 100644 index 0000000..0cf40c1 --- /dev/null +++ b/README @@ -0,0 +1,13 @@ +Development +=========== + +You can start a dev shell with Nix. First run: + + direnv allow + +Assuming you have nix installed, this will tell direnv to load the nix-shell +environment by default. Or just run `nix-shell`. + +Now, to start a repl, just do `sbcl`, or run `start-repl.sh`. + +Then in emacs, `M-x slime-connect`. diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..b5c4f45 --- /dev/null +++ b/shell.nix @@ -0,0 +1,19 @@ +{ pkgs ? import {} }: + +pkgs.mkShell { + + packages = with pkgs; [ + lolcat + (lispPackages_new.sbclWithPackages (p: with p; [ + asdf + swank + quickproject + alexandria + ])) + ]; + + shellHook = '' + echo cl-gemini | figlet | lolcat + ''; + +} diff --git a/start-repl.sh b/start-repl.sh new file mode 100755 index 0000000..5cc17bb --- /dev/null +++ b/start-repl.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +sbcl \ + --eval '(require :asdf)' \ + --eval '(require :swank)' \ + --eval '(swank:create-server)' -- cgit v1.2.3