Use new to-edn function to generate config.

This commit is contained in:
niten 2022-05-30 16:09:14 -07:00
parent 355ba09f04
commit cf2dd19b5f
3 changed files with 53 additions and 10 deletions

View File

@ -102,15 +102,49 @@
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1645296114,
"narHash": "sha256-y53N7TyIkXsjMpOG7RhvqJFGDacLs9HlyHeSTBioqYU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "530a53dcbc9437363471167a5e4762c5fcfa34a1",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-21.05",
"type": "indirect"
}
},
"root": {
"inputs": {
"build-tools-src": "build-tools-src",
"clj2nix": "clj2nix",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs_2",
"to-edn": "to-edn",
"utils": "utils_2"
}
},
"to-edn": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1653952083,
"narHash": "sha256-kmPtkcrbS6UtyjXdRWPnqQ0PFney+pPjpgYn3mLV28Y=",
"ref": "master",
"rev": "1fdfabc55c600c121fda29f4d7764fee56fbb958",
"revCount": 3,
"type": "git",
"url": "https://git.fudo.org/fudo-public/to-edn.git"
},
"original": {
"type": "git",
"url": "https://git.fudo.org/fudo-public/to-edn.git"
}
},
"utils": {
"locked": {
"lastModified": 1637014545,
@ -128,11 +162,11 @@
},
"utils_2": {
"locked": {
"lastModified": 1652776076,
"narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=",
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"type": "github"
},
"original": {

View File

@ -13,9 +13,11 @@
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
to-edn.url = "git+https://git.fudo.org/fudo-public/to-edn.git";
};
outputs = { self, nixpkgs, utils, clj2nix, build-tools-src, gitignore, ... }:
outputs =
{ self, nixpkgs, utils, clj2nix, build-tools-src, gitignore, to-edn, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages."${system}";
@ -25,8 +27,10 @@
};
in {
lib = {
mkClojureLib =
pkgs.callPackage ./mkClojureLib.nix { inherit build-tools-jar; };
mkClojureLib = pkgs.callPackage ./mkClojureLib.nix {
inherit build-tools-jar;
inherit (to-edn.lib) toEDN;
};
};
devShell."${system}" =
pkgs.mkShell { buildInputs = with pkgs; [ clojure clj2nix ]; };

View File

@ -1,11 +1,16 @@
{ lib, stdenv, callPackage, clojure, build-tools-jar, writeText }:
{ lib, stdenv, callPackage, clojure, build-tools-jar, writeText, toEDN }:
{ src, name, group, version, clj-deps, src-paths }:
with lib;
let
build-tools-deps = ''
{ :aliases { :build { :ns-build build :replace-deps { io.github.clojure/tools.build { :local/root "${build-tools-jar}" } } } } }'';
build-tools-deps = toEDN {
aliases.build = {
ns-build = "'build";
replace-deps."'io.github.clojure/tools.build"."local/root" =
"${build-tools-jar}";
};
};
classpath = clj-deps.makeClasspaths { };
@ -28,7 +33,7 @@ in stdenv.mkDerivation {
clojure \
-Scp .:${build-tools-jar}:${classpath} \
-Sdeps ${build-tools-deps} \
-Sdeps ${builtins.trace build-tools-deps build-tools-deps} \
-X:build \
lib-uberjar \
:project ${group}/${name} \