summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorErlend Hamberg <erlend@hamberg.no>2022-01-03 23:10:25 +0100
committerGitHub <noreply@github.com>2022-01-04 07:10:25 +0900
commit3083dde52b0c71e511fbc00a0b509c92a98615fd (patch)
tree1ebffc5b174bfbb4d6716909f27a0a8446e46131 /doc
parent7db30a6749ded6d660317fbea5422c379089b8d8 (diff)
downloadnixpkgs-3083dde52b0c71e511fbc00a0b509c92a98615fd.tar
nixpkgs-3083dde52b0c71e511fbc00a0b509c92a98615fd.tar.gz
nixpkgs-3083dde52b0c71e511fbc00a0b509c92a98615fd.tar.bz2
nixpkgs-3083dde52b0c71e511fbc00a0b509c92a98615fd.tar.lz
nixpkgs-3083dde52b0c71e511fbc00a0b509c92a98615fd.tar.xz
nixpkgs-3083dde52b0c71e511fbc00a0b509c92a98615fd.tar.zst
nixpkgs-3083dde52b0c71e511fbc00a0b509c92a98615fd.zip
Beam/Elixir: Add section on using an overlay (#153348)
* Beam/Elixir: Add section on using an overlay
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/beam.section.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/languages-frameworks/beam.section.md b/doc/languages-frameworks/beam.section.md
index 9b09d0329c5..6552f6cce5e 100644
--- a/doc/languages-frameworks/beam.section.md
+++ b/doc/languages-frameworks/beam.section.md
@@ -280,6 +280,30 @@ mkShell {
 }
 ```
 
+### Using an overlay
+
+If you need to use an overlay to change some attributes of a derivation, e.g. if you need a bugfix from a version that is not yet available in nixpkgs, you can override attributes such as `version` (and the corresponding `sha256`) and then use this overlay in your development environment:
+
+#### `shell.nix`
+
+```nix
+let
+  elixir_1_13_1_overlay = (self: super: {
+      elixir_1_13 = super.elixir_1_13.override {
+        version = "1.13.1";
+        sha256 = "0z0b1w2vvw4vsnb99779c2jgn9bgslg7b1pmd9vlbv02nza9qj5p";
+      };
+    });
+  pkgs = import <nixpkgs> { overlays = [ elixir_1_13_1_overlay ]; };
+in
+with pkgs;
+mkShell {
+  buildInputs = [
+    elixir_1_13
+  ];
+}
+```
+
 #### Elixir - Phoenix project {#elixir---phoenix-project}
 
 Here is an example `shell.nix`.