dev-templates/clojure/flake.nix

37 lines
931 B
Nix
Raw Normal View History

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