source .env in devshell if one is pressent #8

merged
opened by nel.pet targeting main from nel.pet/tranquil: main
Changed files
+20 -2
+2 -1
.envrc
··· 1 - use flake;
··· 1 + use flake path:.; 2 +
+18 -1
shell.nix
··· 1 { 2 mkShell, 3 callPackage, 4 rustPlatform, ··· 25 26 env = { 27 RUST_SRC_PATH = rustPlatform.rustLibSrc; 28 - }; 29 30 packages = [ 31 just
··· 1 { 2 + lib, 3 mkShell, 4 callPackage, 5 rustPlatform, ··· 26 27 env = { 28 RUST_SRC_PATH = rustPlatform.rustLibSrc; 29 + } 30 + # isabel if this is like a horrible way to do this forgive me for my sins ig 31 + # if you can make this better go do it and tell me how or something :3 32 + // builtins.fromTOML ( 33 + (s: if s == "" then s else s + "\"") (lib.replaceStrings [ "\n" "=" "\"" ] [ "\"\n" "=\"" "\\\"" ] 34 + (lib.concatStringsSep "\n" 35 + (lib.filter (line: !lib.hasPrefix "#" line && line != "") 36 + (lib.splitString "\n" 37 + (if lib.pathIsRegularFile ./.env 38 + then (lib.readFile ./.env) 39 + else "" 40 + ) 41 + ) 42 + ) 43 + ) 44 + ) 45 + ); 46 47 packages = [ 48 just