Last active
October 12, 2017 16:34
-
-
Save oscarduignan/821a0201e416144b11e8b4653a8afbd4 to your computer and use it in GitHub Desktop.
nixos package and an overlay that uses it to install commandbox (command line tool for the lucee cfml programming language)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self: super: { | |
commandbox = super.callPackage /path/to/commandbox_package {}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, fetchurl, unzip, makeWrapper, jre }: | |
stdenv.mkDerivation rec { | |
name = "commandbox-3.8.0"; | |
phases = ["unpackPhase" "patchPhase" "installPhase"]; | |
src = fetchurl { | |
name = "${name}.zip"; | |
url = "https://www.ortussolutions.com/parent/download/commandbox/type/bin"; # will break when there's a new release... | |
sha256 = "e184e380713b6e4e94c1266bf4abc352da2e5c7b19bdb9d5ce5f36665d1c58ec"; | |
}; | |
sourceRoot = "./"; | |
buildInputs = [ makeWrapper unzip ]; | |
installPhase = '' | |
mkdir -p $out/bin | |
cp ./box $out/bin | |
wrapProgram $out/bin/box --prefix PATH ":" ${jre}/bin ; | |
''; | |
} |
To install this I put the overlay at ~/.config/nixpkgs/overlays/commandbox.nix
and the package at ~/.config/nixpkgs/pkgs/commandbox.nix
and update the paths in the file above accordingly and run nix-env -i commandbox
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With the overlay in place you can run the commands below
After running
nix-shell
ornix-env -i
try runningbox
to interact with the toolImportant: a "problem" with this is that it's downloading the binary rather than building from source. I couldn't work out how to build the tool myself, build process seems to be using ANT. Extra problem is that this URL points to the latest binary not just version 3.8.0 - I couldn't find a way to get just the specific version we want - tried checking the docker images but they also just use whatever the latest version is. Not ideal but good enough, if you try to build this and it fails then it's likely they released a new version so you need to update the sha256 for the zip file you get from the url listed in the above derivation.