Skip to content

Commit

Permalink
Add nix flake and clj-build framework for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
willcohen committed Apr 9, 2024
1 parent d3dea14 commit bda5f5a
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,20 @@ update the `deps.edn` from the project root is:

`clj -A:depify | clj -A:zprint > deps.edn.tmp ; mv deps.edn.tmp deps.edn`

# Development environment using nix

For a reproducible development environment, `geo` provides a `flake.nix`.

On a machine with nix installed:

``` bash
$ nix develop
...

$ clj -T:build ci
$ clj -T:build install
```

# License

This project and many of its dependencies are licensed under the Eclipse Public
Expand Down
6 changes: 5 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
com.fasterxml.jackson.dataformat/jackson-dataformat-smile #:mvn{:version "2.10.2"},
criterium #:mvn{:version "0.4.6"},
midje #:mvn{:version "1.10.5"},
org.clojure/clojure #:mvn{:version "1.10.3"}}}},
org.clojure/clojure #:mvn{:version "1.10.3"}}
:main-opts ["-m"]}
:build {:deps {io.github.seancorfield/build-clj
{:git/tag "v0.6.7" :git/sha "22c2d09"}}
:ns-default build}}
:deps {ch.hsr/geohash #:mvn{:version "1.4.0"},
com.uber/h3 #:mvn{:version "3.7.1"},
org.clojure/math.numeric-tower #:mvn{:version "0.0.5"},
Expand Down
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
description = "Flake to manage clojure workspace";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};

in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
clojure
jdk
leiningen
];
shellHook = ''
export JAVA_HOME=${pkgs.jdk}
PATH="${pkgs.jdk}/bin:$PATH"
'';
};
});
}

0 comments on commit bda5f5a

Please sign in to comment.