summaryrefslogtreecommitdiffstats
path: root/shell.nix
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-12-09 11:46:45 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-12-09 17:24:50 +0100
commite0ab343878d20cc071b669865ca45f9ccbae1438 (patch)
treed91172df6ef96fce47a7fe083d669145e0928a25 /shell.nix
parent9e1547a2e3d139d3ac723ee6f9522d360fa8a43e (diff)
Add example environment in shell.nix
This environment is default selected. With nix-shell ./shell.nix --argstr example 1 it can be selected explicitely. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix29
1 files changed, 25 insertions, 4 deletions
diff --git a/shell.nix b/shell.nix
index 4657359..d52b014 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,4 +1,4 @@
-{ ... }:
+{ example ? "1", ... }:
let
moz_overlay = import (
@@ -16,8 +16,29 @@ let
PG_PW = "password";
PG_CONTAINER_NAME = "pg-dev-container";
+
+ example_1_env = {
+ BUTIDO_RELEASES = "/tmp/example-1-releases";
+ BUTIDO_STAGING = "/tmp/example-1-staging";
+ BUTIDO_SOURCE_CACHE = "/tmp/example-1-sources";
+ BUTIDO_LOG_DIR = "/tmp/example-1-logs";
+ BUTIDO_REPO = "/tmp/example-1-repo";
+
+ BUTIDO_DATABASE_HOST = "localhost";
+ BUTIDO_DATABASE_PORT = 5432;
+ BUTIDO_DATABASE_USER = PG_USER;
+ BUTIDO_DATABASE_PASSWORD = PG_PW;
+ BUTIDO_DATABASE_NAME = PG_DB;
+ };
+
+ selectedEnv = {
+ "1" = example_1_env;
+ }."${example}";
+
+
in
-pkgs.mkShell {
+pkgs.mkShell (
+{
buildInputs = with pkgs; [
rustChannels.stable.rust-std
rustChannels.stable.rust
@@ -42,6 +63,6 @@ pkgs.mkShell {
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang}/lib";
inherit PG_USER PG_DB PG_PW PG_CONTAINER_NAME;
-}
-
+} // selectedEnv
+)