summary refs log tree commit diff
path: root/shell.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-09-14 08:22:22 +0000
committerAlyssa Ross <hi@alyssa.is>2022-09-14 08:24:39 +0000
commit2cc5bf637f944ec950f7a8162018f421e6671315 (patch)
tree82dca4abdcfdfe10768b48026b241598249546b0 /shell.nix
parenteb2b4c7c89881eb622412ca2d87e9606f5940a30 (diff)
downloadspectrum-2cc5bf637f944ec950f7a8162018f421e6671315.tar
spectrum-2cc5bf637f944ec950f7a8162018f421e6671315.tar.gz
spectrum-2cc5bf637f944ec950f7a8162018f421e6671315.tar.bz2
spectrum-2cc5bf637f944ec950f7a8162018f421e6671315.tar.lz
spectrum-2cc5bf637f944ec950f7a8162018f421e6671315.tar.xz
spectrum-2cc5bf637f944ec950f7a8162018f421e6671315.tar.zst
spectrum-2cc5bf637f944ec950f7a8162018f421e6671315.zip
shell.nix: automatically configure b4
This will allow people who just want to test one patch series to skip
an annoying setup process.  To be honest, I'm not sure if it's worth
keeping the documentation about manually setting it up.  I'm worried
it'll just confuse people.  But I'm keeping it for now.  We can remove
it later.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/shell.nix b/shell.nix
index 4dc8558..77deb2c 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,8 +1,16 @@
 # SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>
+# SPDX-FileCopyrightText: 2022 Unikie
 # SPDX-License-Identifier: MIT
 
 { config ? import nix/eval-config.nix {} }: with config.pkgs;
 
 mkShell {
-  nativeBuildInputs = [ reuse rustfmt ];
+  nativeBuildInputs = [ b4 reuse rustfmt ];
+
+  shellHook = ''
+    declare -igx GIT_CONFIG_COUNT
+    export "GIT_CONFIG_KEY_''${GIT_CONFIG_COUNT:-0}"=b4.midmask
+    export "GIT_CONFIG_VALUE_''${GIT_CONFIG_COUNT:-0}"=https://spectrum-os.org/lists/archives/spectrum-devel/%s
+    GIT_CONFIG_COUNT+=1
+  '';
 }