summary refs log tree commit diff
path: root/doc/builders/special
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-10-12 22:59:19 +0200
committerRobert Hensing <robert@roberthensing.nl>2023-10-12 23:10:41 +0200
commit508c310222b7f07ad9cf6752fdd5c1af59a37061 (patch)
tree375f518fb7c3e90bc59773d2fe56def5f6c45b39 /doc/builders/special
parent9443a0b51e356116ae4ee22be9b8aae5d3bcd386 (diff)
downloadnixpkgs-508c310222b7f07ad9cf6752fdd5c1af59a37061.tar
nixpkgs-508c310222b7f07ad9cf6752fdd5c1af59a37061.tar.gz
nixpkgs-508c310222b7f07ad9cf6752fdd5c1af59a37061.tar.bz2
nixpkgs-508c310222b7f07ad9cf6752fdd5c1af59a37061.tar.lz
nixpkgs-508c310222b7f07ad9cf6752fdd5c1af59a37061.tar.xz
nixpkgs-508c310222b7f07ad9cf6752fdd5c1af59a37061.tar.zst
nixpkgs-508c310222b7f07ad9cf6752fdd5c1af59a37061.zip
darwin.linux-builder: Expose nixosConfig and nixosOptions attributes
I chose not to do nixos.{config, options} because that would make it
look too much like a configuration object, which it is not.

A configuration object I would define as for example the result of
calling NixOS, an attrset with `_type = "configuration";`.

Recreating a configuration object without evalModules is quite
feasible but not guaranteed to be correct, and not maintainable.
Diffstat (limited to 'doc/builders/special')
-rw-r--r--doc/builders/special/darwin-builder.section.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/builders/special/darwin-builder.section.md b/doc/builders/special/darwin-builder.section.md
index 13d01a0e3af..e37fabe01a3 100644
--- a/doc/builders/special/darwin-builder.section.md
+++ b/doc/builders/special/darwin-builder.section.md
@@ -157,3 +157,17 @@ in the example below and rebuild.
 You may make any other changes to your VM in this attribute set. For example,
 you could enable Docker or X11 forwarding to your Darwin host.
 
+## Troubleshooting the generated configuration {#sec-darwin-builder-troubleshoot}
+
+The `linux-builder` package exposes the attributes `nixosConfig` and `nixosOptions` that allow you to inspect the generated NixOS configuration in the `nix repl`. For example:
+
+```
+$ nix repl --file ~/src/nixpkgs --argstr system aarch64-darwin
+
+nix-repl> darwin.linux-builder.nixosConfig.nix.package
+«derivation /nix/store/...-nix-2.17.0.drv»
+
+nix-repl> :p darwin.linux-builder.nixosOptions.virtualisation.memorySize.definitionsWithLocations
+[ { file = "/home/user/src/nixpkgs/nixos/modules/profiles/macos-builder.nix"; value = 3072; } ]
+
+```