about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/systems/examples.nix6
-rw-r--r--lib/trivial.nix62
2 files changed, 64 insertions, 4 deletions
diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix
index 79ec4461e4193..6a9427b2d9de7 100644
--- a/lib/systems/examples.nix
+++ b/lib/systems/examples.nix
@@ -59,7 +59,7 @@ rec {
 
   armv7a-android-prebuilt = {
     config = "armv7a-unknown-linux-androideabi";
-    rustc.config = "armv7-linux-androideabi";
+    rust.rustcTarget = "armv7-linux-androideabi";
     sdkVer = "28";
     ndkVer = "24";
     useAndroidPrebuilt = true;
@@ -67,7 +67,7 @@ rec {
 
   aarch64-android-prebuilt = {
     config = "aarch64-unknown-linux-android";
-    rustc.config = "aarch64-linux-android";
+    rust.rustcTarget = "aarch64-linux-android";
     sdkVer = "28";
     ndkVer = "24";
     useAndroidPrebuilt = true;
@@ -207,7 +207,7 @@ rec {
   aarch64-embedded = {
     config = "aarch64-none-elf";
     libc = "newlib";
-    rustc.config = "aarch64-unknown-none";
+    rust.rustcTarget = "aarch64-unknown-none";
   };
 
   aarch64be-embedded = {
diff --git a/lib/trivial.nix b/lib/trivial.nix
index dee7eca9699a0..20a3ffebbc2bb 100644
--- a/lib/trivial.nix
+++ b/lib/trivial.nix
@@ -403,7 +403,7 @@ in {
     On each release the first letter is bumped and a new animal is chosen
     starting with that new letter.
   */
-  codeName = "Vicuña";
+  codeName = "Vicuna";
 
   /**
     Returns the current nixpkgs version suffix as string.
@@ -623,6 +623,37 @@ in {
   /**
     Reads a JSON file.
 
+    # Examples
+    :::{.example}
+    ## `lib.trivial.importJSON` usage example
+
+    example.json
+    ```json
+    {
+      "title": "Example JSON",
+      "hello": {
+        "world": "foo",
+        "bar": {
+          "foobar": true
+        }
+      }
+    }
+    ```
+
+    ```nix
+    importJSON ./example.json
+    => {
+      title = "Example JSON";
+      hello = {
+        world = "foo";
+        bar = {
+          foobar = true;
+        };
+      };
+    }
+    ```
+
+    :::
 
     # Inputs
 
@@ -642,6 +673,35 @@ in {
   /**
     Reads a TOML file.
 
+    # Examples
+    :::{.example}
+    ## `lib.trivial.importTOML` usage example
+
+    example.toml
+    ```toml
+    title = "TOML Example"
+
+    [hello]
+    world = "foo"
+
+    [hello.bar]
+    foobar = true
+    ```
+
+    ```nix
+    importTOML ./example.toml
+    => {
+      title = "TOML Example";
+      hello = {
+        world = "foo";
+        bar = {
+          foobar = true;
+        };
+      };
+    }
+    ```
+
+    :::
 
     # Inputs