diff --git a/content/config/nushell/env.nu.tmpl b/content/config/nushell/env.nu.tmpl index 631b122..2cb7209 100644 --- a/content/config/nushell/env.nu.tmpl +++ b/content/config/nushell/env.nu.tmpl @@ -98,3 +98,8 @@ $env.LTEX_GLOBAL_STORAGE_PATH = "{{dirs.data}}/ltex/" {{#if-installed librewolf}} $env.BROWSER = "librewolf" {{/if-installed}} + +{{#if (eq ctx.environment "unitb")}} +$env.OPENSSL_DIR = "/home/linuxbrew/.linuxbrew" +$env.OPENSSL_STATIC = true +{{/if}} diff --git a/content/config/nushell/scripts/utils.nu b/content/config/nushell/scripts/utils.nu index fd06bb6..6d1f59e 100644 --- a/content/config/nushell/scripts/utils.nu +++ b/content/config/nushell/scripts/utils.nu @@ -95,7 +95,19 @@ export def --env dotenv [file=".env"] { } ( open $file | lines - | each { parse "{key}={value}" | first | { $in.key: $in.value} } + | where $it !~ "^\\s*#.*" + | each {|line| + try { + $line | parse "{key}=\"{value}\"" | first | { $in.key: ($"\"($in.value)\"" | from nuon) } + } catch { + try { + $line | parse "{key}={value}" | first | { $in.key: $in.value } + } catch { + null + } + } + } + | where $it != null | reduce --fold {} {|it, acc| $acc | merge $it } | load-env $in )