-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
restrict-eval in niv #145
Comments
We use
|
Interesting. I was told by different people that restrict-eval prevents IFD/R(readFile)FD and believed it. My understanding of |
My understanding of It pretty much just affects which files you can put into the nix store. Once you've done that, though, you're fine to import from them. So the particular common case of "IFD from fixed-output derivation" does work. |
Thanks! This is an interesting idea, but no real application then. Closing! |
Actually, I confirm: builtins.fetchurl url fetchTarball url, builtins.fetchTarball url with import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-14.12.tar.gz) {}; stdenv.mkDerivation { … } Note that when obtaining the hash with nix-prefetch-url the option --unpack is required. This function can also verify the contents against a hash. In that case, the function takes a set instead of a URL. The set requires the attribute url and the attribute sha256, e.g. with import (fetchTarball { stdenv.mkDerivation { … } |
When enabling
restrict-eval
, with--option restrict-eval true
, Nix adds some restrictions to the evaluation:(and a few other things irrelevant here). I had to fix naersk to work with
restrict-eval
and had to hack the build steps to enable restricted evaluation. It amounted to generating aNIX_PATH
fromsources.json
(this is needed to access e.g.nixpkgs
):then by tweaking the
sources.nix
all sources can be access with<source-name>
, like<nixpkgs>
:this will be trivially solved by flakes, although in the meantime
niv
could have some support for populating theNIX_PATH
.The text was updated successfully, but these errors were encountered: