summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-07-30 14:55:41 -0400
committerBen Sima <ben@bsima.me>2022-07-30 14:55:41 -0400
commit8f9de177e3cfed26cf9d67fd263d26ba85640eb2 (patch)
tree7c9c98746a55116ca7293a57a6123dcf473daa6a
Initialize dev shell
-rw-r--r--.envrc9
-rw-r--r--.gitignore1
-rw-r--r--README13
-rw-r--r--shell.nix19
-rwxr-xr-xstart-repl.sh5
5 files changed, 47 insertions, 0 deletions
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 <nixpkgs> {} }:
+
+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)'