Disallow IFD in flakes (#502)

I think it is surprising that `flake-info` tries to build things in
order to index flakes. Hence, forbid IFD.

`--read-only` is for performance, see https://github.com/NixOS/nix/pull/6323
This commit is contained in:
Naïm Camille Favier 2022-07-21 12:27:21 +02:00 committed by GitHub
parent 18e5da679b
commit c43ed8c85f
Failed to generate hash of commit

View file

@ -9,7 +9,7 @@ use std::io::Write;
use std::path::PathBuf; use std::path::PathBuf;
const SCRIPT: &str = include_str!("flake_info.nix"); const SCRIPT: &str = include_str!("flake_info.nix");
const ARGS: [&str; 3] = ["eval", "--json", "--no-write-lock-file"]; const ARGS: [&str; 5] = ["eval", "--json", "--no-allow-import-from-derivation", "--read-only", "--no-write-lock-file"];
/// Uses `nix` to fetch the provided flake and read general information /// Uses `nix` to fetch the provided flake and read general information
/// about it using `nix flake info` /// about it using `nix flake info`