From 5f6eb6eb446d911228e830f45edb8ced8413bb58 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Mon, 10 Jun 2024 19:55:40 -0700 Subject: doc: rewrite the multi-user documentation to actually talk about security It's in the security section, and it was totally outdated anyway. I took the opportunity to write down the stuff we already believed. Change-Id: I73e62ae85a82dad13ef846e31f377c3efce13cb0 --- src/nix/flake.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/nix') diff --git a/src/nix/flake.md b/src/nix/flake.md index 9188bca74..8f0163717 100644 --- a/src/nix/flake.md +++ b/src/nix/flake.md @@ -394,15 +394,17 @@ The following attributes are supported in `flake.nix`: value (e.g. `packages.x86_64-linux` must be an attribute set of derivations built for the `x86_64-linux` platform). -* `nixConfig`: a set of `nix.conf` options to be set when evaluating any - part of a flake. In the interests of security, only a small set of - set of options is allowed to be set without confirmation so long as [`accept-flake-config`](@docroot@/command-ref/conf-file.md#conf-accept-flake-config) is not enabled in the global configuration: +* `nixConfig`: a set of `nix.conf` options to be set when evaluating any part of a flake. + This attribute is only considered if the flake is at top-level (i.e. if it is passed directly to `nix build`, `nix run`, etc, rather than as an input of another flake). + In the interests of security, only a small set of set of options is allowed to be set without confirmation so long as [`accept-flake-config`](@docroot@/command-ref/conf-file.md#conf-accept-flake-config) is not enabled in the global configuration: - [`bash-prompt`](@docroot@/command-ref/conf-file.md#conf-bash-prompt) - [`bash-prompt-prefix`](@docroot@/command-ref/conf-file.md#conf-bash-prompt-prefix) - [`bash-prompt-suffix`](@docroot@/command-ref/conf-file.md#conf-bash-prompt-suffix) - [`flake-registry`](@docroot@/command-ref/conf-file.md#conf-flake-registry) - [`commit-lockfile-summary`](@docroot@/command-ref/conf-file.md#conf-commit-lockfile-summary) + For the avoidance of doubt, setting `accept-flake-config` in `nix.conf` or passing `--accept-flake-config` *allows root access to your machine* if you are running as a trusted user and don't read `nixConfig` in every flake you build. + ## Flake inputs The attribute `inputs` specifies the dependencies of a flake, as an -- cgit v1.2.3