From 7a71de0df523b49f7f1abae1b3ba951b9e36eb02 Mon Sep 17 00:00:00 2001 From: Peter Selby Date: Tue, 3 Aug 2021 11:44:54 -0700 Subject: [PATCH] Oh, this has to be committed? --- flake.nix | 19 +++++++++++++------ src/{worther.clj => worther/core.clj} | 0 src/worther/deps.edn | 6 ------ worther.nix | 5 +++-- 4 files changed, 16 insertions(+), 14 deletions(-) rename src/{worther.clj => worther/core.clj} (100%) delete mode 100644 src/worther/deps.edn diff --git a/flake.nix b/flake.nix index 1fc977e..5a15498 100644 --- a/flake.nix +++ b/flake.nix @@ -7,16 +7,23 @@ flake-utils.url = "github:numtide/flake-utils"; }; + # outputs = { self, nixpkgs, flake-utils, ... }: with nixpkgs.lib; let + # system = "x86_64-linux"; + # pkgs = import nixpkgs { inherit system; }; + # worther = pkgs.callPackage ./worther.nix { pkgs = pkgs; }; + # in rec { + # packages.${system}.worther = worther; + # defaultPackage = packages.${system}.worther; + # }; + outputs = { self, nixpkgs, flake-utils, ... }: with nixpkgs.lib; flake-utils.lib.eachDefaultSystem (system: let - pkgs = nixpkgs.legacyPackages.${system}; - worther = callPackage ./worther.nix { pkgs = nixpkgs; }; + pkgs = import nixpkgs { inherit system; }; + worther = pkgs.callPackage ./worther.nix { pkgs = pkgs; }; in rec { - packages = flake-utils.lib.flattenTree { - worther = nixpkgs.legacyPackages.x86_64-linux.worther; - }; - defaultPackage = packages.worther; + packages.worther = worther; + defaultPackage = self.packages.${system}.worther; }); } diff --git a/src/worther.clj b/src/worther/core.clj similarity index 100% rename from src/worther.clj rename to src/worther/core.clj diff --git a/src/worther/deps.edn b/src/worther/deps.edn deleted file mode 100644 index ffe769c..0000000 --- a/src/worther/deps.edn +++ /dev/null @@ -1,6 +0,0 @@ -{:deps - {juxt/crux-core {:mvn/version "21.05-1.17.0-beta"} - org.clojure/clojure {:mvn/version "1.10.3"} - org.clojure/core.match {:mvn/version "1.0.0"} - org.clojure/spec.alpha {:mvn/version "0.2.194"} - org.clojure/tools.deps.alpha {:mvn/version "0.11.926"}}} diff --git a/worther.nix b/worther.nix index 50c6cd5..052e9cd 100644 --- a/worther.nix +++ b/worther.nix @@ -1,5 +1,6 @@ { pkgs ? import {}, ... }: + let cljdeps = pkgs.callPackage ./deps.nix {}; classpath = cljdeps.makeClasspaths {}; @@ -16,7 +17,7 @@ in pkgs.stdenv.mkDerivation { nativeBuildInputs = with pkgs; [ jre makeWrapper ]; - buildInputs = map (x: x.path) cljdeps.packages; + buildInputs = map (x: x.paths) cljdeps.packages; src = ./src; @@ -24,7 +25,7 @@ in pkgs.stdenv.mkDerivation { buildPhase = '' mkdir classes - java -cp .:${classpath} clojure.main -e "(compile '${main-class}')" + java -cp ./src:${classpath} clojure.main -e "(compile '${main-class})" jar cmf ${manifest} out.jar -C classes worther '';