From 13a9c6d092666cda942a70138919b140853c7fa1 Mon Sep 17 00:00:00 2001 From: nelind Date: Sun, 28 Dec 2025 01:22:46 +0100 Subject: [PATCH] source .env in devshell if one is pressent Change-Id: uqpxporpxznqzptyyrvrprsnnzusyvlq --- .envrc | 3 ++- shell.nix | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.envrc b/.envrc index 44610e5..54726b5 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,2 @@ -use flake; +use flake path:.; + diff --git a/shell.nix b/shell.nix index d5602a8..0843fbf 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,5 @@ { + lib, mkShell, callPackage, rustPlatform, @@ -25,7 +26,23 @@ in mkShell { env = { RUST_SRC_PATH = rustPlatform.rustLibSrc; - }; + } + # isabel if this is like a horrible way to do this forgive me for my sins ig + # if you can make this better go do it and tell me how or something :3 + // builtins.fromTOML ( + (s: if s == "" then s else s + "\"") (lib.replaceStrings [ "\n" "=" "\"" ] [ "\"\n" "=\"" "\\\"" ] + (lib.concatStringsSep "\n" + (lib.filter (line: !lib.hasPrefix "#" line && line != "") + (lib.splitString "\n" + (if lib.pathIsRegularFile ./.env + then (lib.readFile ./.env) + else "" + ) + ) + ) + ) + ) + ); packages = [ just -- 2.50.1