This commit is contained in:
Vlad 2023-03-09 10:09:39 +00:00 committed by GitHub
commit 53d06aad78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 4 deletions

4
.gitignore vendored
View file

@ -204,3 +204,7 @@ sftp-config.json
# Vagrant # Vagrant
.vagrant/ .vagrant/
ubuntu-xenial-16.04-cloudimg-console.log ubuntu-xenial-16.04-cloudimg-console.log
# Direnv
.direnv

View file

@ -14,9 +14,10 @@ completed.
You have a few options for installation: You have a few options for installation:
- Install the dependencies for the koans (such as Clojure) on your machine - Install the dependencies for the koans (such as Clojure) on your machine.
- Use Vagrant and the configuration in this repository - Use Vagrant and the configuration in this repository.
- Use Docker - Use Docker.
- Use Nix Develop environment.
Instructions for each option are below! Instructions for each option are below!
@ -69,6 +70,21 @@ To start up a REPL:
docker run --rm -it -v $(pwd):/app -w /app clojure lein repl docker run --rm -it -v $(pwd):/app -w /app clojure lein repl
``` ```
### Installation with Nix Develop Environment
Make sure you have [nix](https://nixos.wiki/wiki/Nix_Installation_Guide) setup,
then run:
```
nix --experimental-features 'nix-command flakes' develop
```
This will drop you into a shell with all the required dependencies installed.
To run koans, in the root of the repository run:
```
lein koan run
```
## Running the Koans ## Running the Koans

31
flake.nix Normal file
View file

@ -0,0 +1,31 @@
{
description = "Clojure Koans";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ ];
pkgs = import nixpkgs {inherit system overlays;};
additionalPkgs = with pkgs; [ ];
buildPkgs = with pkgs; [ clojure leiningen ];
project = pkgs.stdenv.mkDerivation {
name = "koans-env";
root = self;
buildInputs = buildPkgs;
shellInputs = additionalPkgs;
};
in {
defaultPackage = project;
devShell = project;
});
}