Browse Source

Oh, this has to be committed?

master
Peter Selby 6 months ago
parent
commit
7a71de0df5
  1. 19
      flake.nix
  2. 0
      src/worther/core.clj
  3. 6
      src/worther/deps.edn
  4. 5
      worther.nix

19
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;
});
}

0
src/worther.clj → src/worther/core.clj

6
src/worther/deps.edn

@ -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"}}}

5
worther.nix

@ -1,5 +1,6 @@
{ pkgs ? import <nixpkgs> {}, ... }:
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
'';

Loading…
Cancel
Save