I’m trying to write a flake that doesn’t build upon nixpkgs. For the purpose of that question, let’s simplify it to “I just want to download and invoke a statically linked binary”. I want to build it in my hydra, which seems to require restricted evaluation mode. Here’s an illustrative flake.nix:
{
description = "small broken example";
outputs = { self }:
let
problem = builtins.fetchurl {
url = "https://busybox.net/downloads/binaries/1.21.1/busybox-x86_64";
sha256 = "8d7a4ac8629db62457447673fd5e3ae857bdf5c4bda46f6c2abc53b3315f4b
f5";
};
in
{
defaultPackage.x86_64-linux = derivation {
name = "test";
builder = problem;
args = [ "echo" "this is not gonna work for multiple reasons" ];
system = "x86_64-linux";
};
};
}
Invocation: nix build --restrict-eval
.
Expected: permission denied, applet not found, but it at least tries to build the derivation.
Observed: error: access to URI 'https://busybox.net/downloads/binaries/1.21.1/busybox-x86_64' is forbidden in restricted mode
.
How am I supposed to fetch stuff then? I presume nixpkgs also starts from something, how does it fetch that something?