


This derivation builds the Maven application while instructing Maven to be in “offline” mode (do not try to contact the remote repositories) and we set the local repository to the output of the previous derivation. Here is a very simple fixed output derivation to demonstrate.

These derivations are allowed to perform network access in sandboxed mode. Using Fixed output derivations! Fixed Output Derivationįixed output derivations (FOD) are derivations that specify the hash of the output contents (Nix typically calculates the hash of the input). How can we hydrate the local Maven repository within a Nix derivation? The builder is also in a chroot directory without access to the local Maven repository ~/.m2. The main crux of packaging a Maven application in a Nix derivation is that the derivation is restricted from performing any network access.
1CHECKER NETOWEK CONNECION FAILS HOW TO
This post will go through a single idiom on how to package a Maven project in Nix that at the very least does not rely on 3rd party support: Double invoking Maven There are several community driven solutions for integrating Maven (Java’s package manager) with Nix all which have their own pitfalls. Surprisingly for Java’s popularity, the Nix Java ecosystem is pretty immature & fragmented.
