build.tools.nix/flake.nix

45 lines
1.4 KiB
Nix

{
description = "clojure/tools.build packaged for NixOS.";
inputs = {
nixpkgs.url = "nixpkgs/nixos-22.05";
utils.url = "github:numtide/flake-utils";
clj2nix.url = "github:hlolli/clj2nix";
build-tools-src = {
url = "github:clojure/tools.build?tag=v0.6.8";
flake = false;
};
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
to-edn.url = "git+https://fudo.dev/public/to-edn.git";
};
outputs =
{ self, nixpkgs, utils, clj2nix, build-tools-src, gitignore, to-edn, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages."${system}";
build-tools-jar = pkgs.callPackage ./build.tools.nix {
version = "0.6.8";
inherit build-tools-src;
inherit (gitignore.lib) gitignoreSource;
};
clj2nix-pkg = clj2nix.packages.${system}.clj2nix;
update-deps = pkgs.writeShellScriptBin "update-deps.sh" ''
${clj2nix-pkg}/bin/clj2nix ${build-tools-src}/deps.edn deps.nix
'';
in {
packages."${system}" = { inherit build-tools-jar; };
defaultPackage."${system}" = self.packages."${system}".build-tools-jar;
lib = {
mkClojureLib =
pkgs.callPackage ./mkClojureLib.nix { inherit (to-edn.lib) toEDN; };
};
devShell."${system}" = pkgs.mkShell {
buildInputs = with pkgs; [ clojure clj2nix-pkg update-deps ];
};
};
}