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 let
base-name = "bebot"; base-name = "bebot";
project = "org.fudo";
version = "0.1"; version = "0.1";
full-name = "${base-name}-${version}"; full-name = "${base-name}-${version}";
@ -13,12 +14,12 @@ let
in stdenv.mkDerivation { in stdenv.mkDerivation {
name = "${full-name}.jar"; name = "${full-name}.jar";
src = gitignoreSource ./.; src = ./.;
buildInputs = [ clojure ] ++ map (d: d.paths) cljdeps.packages; buildInputs = [ clojure ] ++ (map (d: d.paths) cljdeps.packages);
buildPhase = pthru '' buildPhase = pthru ''
HOME=./home HOME=./home
mkdir -p $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 = '' installPhase = ''
cp ./target/bebot-${version}-standalone.jar $out 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,15 +7,9 @@
net.bis5.mattermost4j/mattermost4j-core { :mvn/version "0.24.0" } net.bis5.mattermost4j/mattermost4j-core { :mvn/version "0.24.0" }
org.fudo/fudo-clojure { 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" :git/url "https://git.fudo.org/fudo-public/fudo-clojure.git"
:sha "2d9303f55f7eac9c2f8989e9a0dde3dc97811220" :sha "1312a2805616b265ed4c89ef6216f300a7a7a155"
} }
io.github.clojure/tools.build {
:git/url "https://github.com/clojure/tools.build.git"
:sha "ba1a2bf421838802e7bdefc541b41f57582e53b6"
}
} }
:aliases { :aliases {
:test { :test {
@ -24,7 +18,7 @@
io.github.cognitect-labs/test-runner io.github.cognitect-labs/test-runner
{ {
:git/url "https://github.com/cognitect-labs/test-runner.git" :git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "e1e292d8332eb7167e402ecb22f36f1443ba85e6" :sha "dfb30dd6605cb6c0efc275e1df1736f6e90d4d73"
} }
} }
:main-opts ["-m" "cognitect.test-runner"] :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": { "nodes": {
"clj2nix": { "clj-nix": {
"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": {
"inputs": { "inputs": {
"devshell": "devshell",
"flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1646480205, "lastModified": 1654165349,
"narHash": "sha256-kekOlTlu45vuK2L9nq8iVN17V3sB0WWPqTTW3a2SQG0=", "narHash": "sha256-rFASjixxLmJ5+2w/i7HA1OVJ1r3gc7LQJzdCd950GZ0=",
"owner": "hercules-ci", "owner": "jlesquembre",
"repo": "gitignore.nix", "repo": "clj-nix",
"rev": "bff2832ec341cf30acb3a4d3e2e7f1f7b590116a", "rev": "5830fa484696e218508a83421c70e3076a1bd982",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "hercules-ci", "owner": "jlesquembre",
"repo": "gitignore.nix", "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" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1637881340, "lastModified": 1654005557,
"narHash": "sha256-/meU5CTm8GnaETZrJa0UqBQvk9T/jKp1+MLIQQ7FTTo=", "narHash": "sha256-J6elwUzPoco+r5qWPHhvS2EHVWomUtNcxzkfdAQOwEU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d460f48ddb884f7270b7f7bfcbf8a7b91140caa5", "rev": "08950a6e29cf7bddee466592eb790a417550f7f9",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1645296114,
"narHash": "sha256-y53N7TyIkXsjMpOG7RhvqJFGDacLs9HlyHeSTBioqYU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "530a53dcbc9437363471167a5e4762c5fcfa34a1",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-21.05", "ref": "nixos-22.05",
"type": "indirect" "type": "indirect"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"clj2nix": "clj2nix", "clj-nix": "clj-nix",
"gitignore": "gitignore", "nixpkgs": "nixpkgs",
"nixpkgs": "nixpkgs_2", "utils": "utils"
"utils": "utils_2"
} }
}, },
"utils": { "utils": {
"locked": { "locked": {
"lastModified": 1637014545, "lastModified": 1653893745,
"narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"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",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

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