summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2024-02-25 14:46:22 -0500
committerKjetil Orbekk <kj@orbekk.com>2024-02-25 14:46:22 -0500
commit116dc5f0b548a43390ee13636b2d372c07af3702 (patch)
tree88d7b2aeba1619a25a694dc08082ae35b1d4ade5
parent465c3a1045625d12a73e723651ae9bd9b0a51cb1 (diff)
update
-rw-r--r--clisp/.envrc1
-rw-r--r--clisp/README.md9
-rw-r--r--clisp/flake.lock26
-rw-r--r--clisp/flake.nix17
-rw-r--r--clisp/kj-sandbox.asd11
-rw-r--r--clisp/kj-sandbox.lisp11
-rw-r--r--clisp/package.lisp4
-rw-r--r--clisp/web.lisp10
8 files changed, 89 insertions, 0 deletions
diff --git a/clisp/.envrc b/clisp/.envrc
new file mode 100644
index 0000000..3550a30
--- /dev/null
+++ b/clisp/.envrc
@@ -0,0 +1 @@
+use flake
diff --git a/clisp/README.md b/clisp/README.md
new file mode 100644
index 0000000..5499573
--- /dev/null
+++ b/clisp/README.md
@@ -0,0 +1,9 @@
+# kj-sandbox
+### _Your Name <your.name@example.com>_
+
+This is a project to do ... something.
+
+## License
+
+Specify license here
+
diff --git a/clisp/flake.lock b/clisp/flake.lock
new file mode 100644
index 0000000..54cb2b7
--- /dev/null
+++ b/clisp/flake.lock
@@ -0,0 +1,26 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1708189888,
+ "narHash": "sha256-gnsICW7R6rFF2WDg5GfimE4XdIfZpLluyEFXx+8K7bY=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "28d6a724f54085377102db7c3278ba82a0a5255f",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/clisp/flake.nix b/clisp/flake.nix
new file mode 100644
index 0000000..644371b
--- /dev/null
+++ b/clisp/flake.nix
@@ -0,0 +1,17 @@
+{
+ description = "A basic flake";
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs";
+ };
+
+ outputs = { self, nixpkgs }:
+ let
+ pkgs = nixpkgs.legacyPackages.x86_64-linux;
+ in
+ {
+ devShell.x86_64-linux = pkgs.mkShell rec {
+ buildInputs = with pkgs; [ sbcl openssl ];
+ LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
+ };
+ };
+}
diff --git a/clisp/kj-sandbox.asd b/clisp/kj-sandbox.asd
new file mode 100644
index 0000000..204c926
--- /dev/null
+++ b/clisp/kj-sandbox.asd
@@ -0,0 +1,11 @@
+;;;; kj-sandbox.asd
+
+(asdf:defsystem #:kj-sandbox
+ :description "Describe kj-sandbox here"
+ :author "Your Name <your.name@example.com>"
+ :license "Specify license here"
+ :version "0.0.1"
+ :serial t
+ :depends-on ("uiop")
+ :components ((:file "package")
+ (:file "kj-sandbox")))
diff --git a/clisp/kj-sandbox.lisp b/clisp/kj-sandbox.lisp
new file mode 100644
index 0000000..85c2646
--- /dev/null
+++ b/clisp/kj-sandbox.lisp
@@ -0,0 +1,11 @@
+;;;; kj-sandbox.lisp
+
+(in-package #:kj-sandbox)
+(require :uiop)
+
+(defun test ()
+ (format t "Hello ~a!~&"
+ (uiop:getenv "USER"))
+ (uiop:run-program "ip a" :output :string))
+
+(test)
diff --git a/clisp/package.lisp b/clisp/package.lisp
new file mode 100644
index 0000000..ece90d6
--- /dev/null
+++ b/clisp/package.lisp
@@ -0,0 +1,4 @@
+;;;; package.lisp
+
+(defpackage #:kj-sandbox
+ (:use #:cl))
diff --git a/clisp/web.lisp b/clisp/web.lisp
new file mode 100644
index 0000000..83015a6
--- /dev/null
+++ b/clisp/web.lisp
@@ -0,0 +1,10 @@
+(ql:quickload :clack)
+
+(defun handler (env)
+ '(200 (:content-type "text/plain")
+ ("Hello, Everyone!")))
+
+(defvar *server*
+ (clack:clackup
+ (lambda (env) (funcall 'handler env))
+ :server :hunchentoot))