build.tools.nix/flake.nix

45 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2022-05-28 11:51:36 -07:00
{
description = "clojure/tools.build packaged for NixOS.";
inputs = {
2022-06-01 13:59:31 -07:00
nixpkgs.url = "nixpkgs/nixos-22.05";
2022-05-28 11:51:36 -07:00
utils.url = "github:numtide/flake-utils";
clj2nix.url = "github:hlolli/clj2nix";
build-tools-src = {
2022-06-01 13:59:31 -07:00
url = "github:clojure/tools.build?tag=v0.6.8";
2022-05-28 11:51:36 -07:00
flake = false;
};
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-03-23 21:25:02 -07:00
to-edn.url = "git+https://fudo.dev/public/to-edn.git";
2022-05-28 11:51:36 -07:00
};
outputs =
{ self, nixpkgs, utils, clj2nix, build-tools-src, gitignore, to-edn, ... }:
2022-05-29 10:22:07 -07:00
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages."${system}";
build-tools-jar = pkgs.callPackage ./build.tools.nix {
2022-06-01 13:59:31 -07:00
version = "0.6.8";
2022-05-29 10:22:07 -07:00
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
'';
2022-05-29 10:22:07 -07:00
in {
2022-05-31 13:07:35 -07:00
packages."${system}" = { inherit build-tools-jar; };
defaultPackage."${system}" = self.packages."${system}".build-tools-jar;
2022-05-29 10:27:08 -07:00
lib = {
2022-05-31 13:07:35 -07:00
mkClojureLib =
pkgs.callPackage ./mkClojureLib.nix { inherit (to-edn.lib) toEDN; };
2022-05-29 10:22:07 -07:00
};
devShell."${system}" = pkgs.mkShell {
buildInputs = with pkgs; [ clojure clj2nix-pkg update-deps ];
};
2022-05-29 10:22:07 -07:00
};
2022-05-28 11:51:36 -07:00
}