diff --git a/cmd/nix-tool/main.go b/cmd/nix-tool/main.go index 0c7b2a5..dc8cc1c 100644 --- a/cmd/nix-tool/main.go +++ b/cmd/nix-tool/main.go @@ -39,7 +39,14 @@ func main() { var extraArgs []string flagStore = strings.TrimSpace(flagStore) if flagStore != string(os.PathSeparator) { - extraArgs = append(extraArgs, "--store", flagStore) + extraArgs = append(extraArgs, + "--store", flagStore, + // do not use any binary cache + nix.FlagOption, nix.OptionBuildUseSubstitutes, nix.ValueFalse, + nix.FlagOption, nix.OptionSubstituters, "", + nix.FlagOption, nix.OptionTrustedSubstituters, "", + nix.FlagOption, nix.OptionTrustedPublicKeys, "", + ) } var stderr io.Writer diff --git a/format.go b/format.go index b4aa208..a821dff 100644 --- a/format.go +++ b/format.go @@ -91,6 +91,17 @@ const ( // Certain commands won’t have to evaluate when invoked for the second time with a particular version of a flake. // Intermediate results are not cached. OptionEvalCache = "eval-cache" + // OptionBuildUseSubstitutes if set to true (default), Nix will use binary substitutes if available. + // This option can be disabled to force building from source. + OptionBuildUseSubstitutes = "build-use-substitutes" + // OptionSubstituters a list of URLs of Nix stores to be used as substituters, separated by whitespace. + // A substituter is an additional store from which Nix can obtain store objects instead of building them. + OptionSubstituters = "substituters" + // OptionTrustedSubstituters a list of Nix store URLs, separated by whitespace. + //These are not used by default, but users of the Nix daemon can enable them by specifying substituters. + OptionTrustedSubstituters = "trusted-substituters" + // OptionTrustedPublicKeys a whitespace-separated list of public keys. + OptionTrustedPublicKeys = "trusted-public-keys" ValueTrue = "true" ValueFalse = "false"