new: add nix flake + instructions on how to use
This commit is contained in:
parent
76b279a8a8
commit
afa811c930
3 changed files with 55 additions and 4 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -204,3 +204,7 @@ sftp-config.json
|
|||
# Vagrant
|
||||
.vagrant/
|
||||
ubuntu-xenial-16.04-cloudimg-console.log
|
||||
|
||||
|
||||
# Direnv
|
||||
.direnv
|
||||
|
|
|
|||
22
README.md
22
README.md
|
|
@ -14,9 +14,10 @@ completed.
|
|||
|
||||
You have a few options for installation:
|
||||
|
||||
- Install the dependencies for the koans (such as Clojure) on your machine
|
||||
- Use Vagrant and the configuration in this repository
|
||||
- Use Docker
|
||||
- Install the dependencies for the koans (such as Clojure) on your machine.
|
||||
- Use Vagrant and the configuration in this repository.
|
||||
- Use Docker.
|
||||
- Use Nix Develop environment.
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
### 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
|
||||
|
||||
|
|
|
|||
31
flake.nix
Normal file
31
flake.nix
Normal 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;
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue