dev-templates/clojure/flake.nix

34 lines
908 B
Nix
Raw Normal View History

2022-08-04 10:19:10 +02:00
{
description = "A Nix-flake-based Clojure development environment";
inputs = { dev.url = "github:the-nix-way/dev-templates"; };
outputs = { self, dev }:
let inherit (dev.lib) flake-utils nixpkgs;
in flake-utils.lib.eachDefaultSystem (system:
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-04 10:19:10 +02:00
in {
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
'';
};
};
});
}