Switched to clj-nix

This commit is contained in:
niten 2022-06-02 19:58:01 -07:00
parent 64c3adbc01
commit a731ed001b
6 changed files with 1570 additions and 1489 deletions

View File

@ -3,6 +3,7 @@
let
base-name = "bebot";
project = "org.fudo";
version = "0.1";
full-name = "${base-name}-${version}";
@ -13,12 +14,12 @@ let
in stdenv.mkDerivation {
name = "${full-name}.jar";
src = gitignoreSource ./.;
buildInputs = [ clojure ] ++ map (d: d.paths) cljdeps.packages;
src = ./.;
buildInputs = [ clojure ] ++ (map (d: d.paths) cljdeps.packages);
buildPhase = pthru ''
HOME=./home
mkdir -p $HOME
clojure -Scp ./src:${classpath} -X:build build/uberjar :project org.fudo/bebot :version 0.1
clojure -Scp ${classpath}:./src -X:build build/uberjar :project ${project}/${base-name} :version ${version}
'';
installPhase = ''
cp ./target/bebot-${version}-standalone.jar $out

1471
deps-lock.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,14 +7,8 @@
net.bis5.mattermost4j/mattermost4j-core { :mvn/version "0.24.0" }
org.fudo/fudo-clojure {
;; :local/root "/nix/store/afrgn7xsiglgfghnfqbba22yq3hc41a6-fudo-clojure-0.1-standalone.jar"
:git/url "https://git.fudo.org/fudo-public/fudo-clojure.git"
:sha "2d9303f55f7eac9c2f8989e9a0dde3dc97811220"
}
io.github.clojure/tools.build {
:git/url "https://github.com/clojure/tools.build.git"
:sha "ba1a2bf421838802e7bdefc541b41f57582e53b6"
:sha "1312a2805616b265ed4c89ef6216f300a7a7a155"
}
}
:aliases {
@ -24,7 +18,7 @@
io.github.cognitect-labs/test-runner
{
:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "e1e292d8332eb7167e402ecb22f36f1443ba85e6"
:sha "dfb30dd6605cb6c0efc275e1df1736f6e90d4d73"
}
}
:main-opts ["-m" "cognitect.test-runner"]

1373
deps.nix

File diff suppressed because it is too large Load Diff

View File

@ -1,121 +1,108 @@
{
"nodes": {
"clj2nix": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs",
"utils": "utils"
},
"locked": {
"lastModified": 1637900288,
"narHash": "sha256-hQdSCIm1WpG5uK9hoe/iagyYc3Fhi8PJzfo1jFBa53g=",
"owner": "hlolli",
"repo": "clj2nix",
"rev": "3d0a38c954c8e0926f57de1d80d357df05fc2f94",
"type": "github"
},
"original": {
"owner": "hlolli",
"repo": "clj2nix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1627913399,
"narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"gitignore": {
"clj-nix": {
"inputs": {
"devshell": "devshell",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1646480205,
"narHash": "sha256-kekOlTlu45vuK2L9nq8iVN17V3sB0WWPqTTW3a2SQG0=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "bff2832ec341cf30acb3a4d3e2e7f1f7b590116a",
"lastModified": 1654165349,
"narHash": "sha256-rFASjixxLmJ5+2w/i7HA1OVJ1r3gc7LQJzdCd950GZ0=",
"owner": "jlesquembre",
"repo": "clj-nix",
"rev": "5830fa484696e218508a83421c70e3076a1bd982",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"owner": "jlesquembre",
"repo": "clj-nix",
"type": "github"
}
},
"devshell": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"clj-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1644227066,
"narHash": "sha256-FHcFZtpZEWnUh62xlyY3jfXAXHzJNEDLDzLsJxn+ve0=",
"owner": "numtide",
"repo": "devshell",
"rev": "7033f64dd9ef8d9d8644c5030c73913351d2b660",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1642700792,
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1637881340,
"narHash": "sha256-/meU5CTm8GnaETZrJa0UqBQvk9T/jKp1+MLIQQ7FTTo=",
"lastModified": 1654005557,
"narHash": "sha256-J6elwUzPoco+r5qWPHhvS2EHVWomUtNcxzkfdAQOwEU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d460f48ddb884f7270b7f7bfcbf8a7b91140caa5",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1645296114,
"narHash": "sha256-y53N7TyIkXsjMpOG7RhvqJFGDacLs9HlyHeSTBioqYU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "530a53dcbc9437363471167a5e4762c5fcfa34a1",
"rev": "08950a6e29cf7bddee466592eb790a417550f7f9",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-21.05",
"ref": "nixos-22.05",
"type": "indirect"
}
},
"root": {
"inputs": {
"clj2nix": "clj2nix",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs_2",
"utils": "utils_2"
"clj-nix": "clj-nix",
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1637014545,
"narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"locked": {
"lastModified": 1652776076,
"narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"type": "github"
},
"original": {

View File

@ -2,34 +2,35 @@
description = "BeBot Mattermost chatbot Clojure library.";
inputs = {
nixpkgs.url = "nixpkgs/nixos-21.05";
nixpkgs.url = "nixpkgs/nixos-22.05";
utils.url = "github:numtide/flake-utils";
clj2nix.url = "github:hlolli/clj2nix";
gitignore = {
url = "github:hercules-ci/gitignore.nix";
clj-nix = {
url = "github:jlesquembre/clj-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, utils, clj2nix, gitignore, ... }:
outputs = { self, nixpkgs, utils, clj-nix, ... }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
bebot-lib = pkgs.callPackage ./bebot.nix {
inherit (gitignore.lib) gitignoreSource;
};
pkgs = nixpkgs.legacyPackages."${system}";
cljpkgs = clj-nix.packages."${system}";
update-deps = pkgs.writeShellScriptBin "update-deps.sh" ''
${clj-nix.packages."${system}".deps-lock}/bin/deps-lock
'';
in {
packages = utils.lib.flattenTree { inherit bebot-lib; };
defaultPackage = self.packages."${system}".bebot-lib;
overlay = final: prev: { inherit bebot-lib; };
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
bash
clojure
jre
clj2nix.packages."${system}".clj2nix
];
packages = {
bebot = cljpkgs.mkCljBin {
projectSrc = ./.;
name = "org.fudo/bebot";
main-ns = "bebot.core";
jdkRunner = pkgs.jdk17_headless;
};
};
defaultPackage = self.packages."${system}".bebot;
devShell =
pkgs.mkShell { buildInputs = with pkgs; [ clojure update-deps ]; };
});
}