dev-templates/clojure/flake.nix

37 lines
931 B
Nix
Raw Normal View History

2022-08-04 01:19:10 -07:00
{
description = "A Nix-flake-based Clojure development environment";
2022-08-20 03:06:53 -07:00
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
};
2022-08-04 01:19:10 -07:00
2022-08-20 03:06:53 -07:00
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
2022-08-04 01:19:10 -07:00
let
jdk = "jdk17";
config = {
packageOverrides = p: {
2022-08-04 01:26:16 -07:00
boot = p.boot.override { jdk = p.${jdk}; };
2022-08-04 01:19:10 -07:00
clojure = p.clojure.override { jdk = p.${jdk}; };
leiningen = p.leiningen.override { jdk = p.${jdk}; };
};
};
pkgs = import nixpkgs { inherit config system; };
2022-08-04 01:26:16 -07:00
inherit (pkgs) boot clojure leiningen mkShell;
2022-08-20 04:47:43 -07:00
in
{
2022-08-04 01:19:10 -07:00
devShells = {
default = mkShell {
2022-08-04 01:26:16 -07:00
buildInputs = [ boot clojure leiningen ];
2022-08-04 01:19:10 -07:00
shellHook = ''
2022-08-04 01:26:16 -07:00
${clojure}/bin/clj --version
2022-08-04 01:19:10 -07:00
'';
};
};
});
}