!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

194 Members
56 Servers

Load older messages


SenderMessageTime
21 Dec 2023
@peter-lustig:matrix.orgpeter-lustig
In reply to @lily:lily.flowers
yeah but do you have github env vars set?
yeah in .env and then I import them with $env/static/..
16:00:19
@lily:lily.flowersLily Fosterah, but is it possible to make them not required during build?16:00:37
@lily:lily.flowersLily Fosteryou can mock up fake ones in the nix build too16:00:47
@peter-lustig:matrix.orgpeter-lustigI guess it is16:01:00
@lily:lily.flowersLily Fosterby writing a .env there or something16:01:03
@peter-lustig:matrix.orgpeter-lustignot sure16:01:05
@peter-lustig:matrix.orgpeter-lustig
In reply to @lily:lily.flowers
you can mock up fake ones in the nix build too
could you show me how I would do that in my current flake
16:01:27
@lily:lily.flowersLily Fosteryeah, one sec. getting personal laptop out16:01:44
@lily:lily.flowersLily Foster
In reply to @peter-lustig:matrix.org
could you show me how I would do that in my current flake
the values don't matter during build right? so they could be empty strings for all your package cares?
16:03:49
@peter-lustig:matrix.orgpeter-lustigyeah i think so16:04:21
@peter-lustig:matrix.orgpeter-lustigworth a try16:04:28
@lily:lily.flowersLily Foster(dynamically grabbing them from the env when they are needed rather than importing from a virtual module would probably be more robust, and would also handle things like the env vars changing during the lifetime of the program better)16:04:51
@lily:lily.flowersLily Foster

you can do something like this though:

env = {
    GITHUB_CLIENT_ID = "";
    GITHUB_CLIENT_SECRET = "";
    ...
}
16:05:19
@lily:lily.flowersLily Fosteron the derivation16:05:23
@peter-lustig:matrix.orgpeter-lustig
In reply to @lily:lily.flowers
(dynamically grabbing them from the env when they are needed rather than importing from a virtual module would probably be more robust, and would also handle things like the env vars changing during the lifetime of the program better)

yeah i had it dynamic before and everything worked, but look at this:

https://kit.svelte.dev/docs/migrating-to-sveltekit-2#dynamic-environment-variables-cannot-be-used-during-prerendering

16:05:33
@peter-lustig:matrix.orgpeter-lustigthat does not work for the new version16:05:47
@lily:lily.flowersLily Foster shouldn't you be using dynamic instead of static then? 16:06:41
@lily:lily.flowersLily Fostersince you want runtime vars, not build-time vars?16:06:46
@lily:lily.flowersLily Foster(if i'm reading this doc right)16:06:52
@peter-lustig:matrix.orgpeter-lustigread what is ent16:07:06
@peter-lustig:matrix.orgpeter-lustigwhen i use dynamic i get an error16:07:11
@peter-lustig:matrix.orgpeter-lustigthat i shoul duse static16:07:15
@peter-lustig:matrix.orgpeter-lustigbecause of the prerendering16:07:20
@lily:lily.flowersLily Fosteroh, so you need real values during build time then?16:07:30
@lily:lily.flowersLily Fosterthat would be secrets baked in to your program :grimc16:07:38
@lily:lily.flowersLily Foster * that would be secrets baked in to your program 😬16:07:45
@lily:lily.flowersLily Fosterdo they have a better way to deal with secrets?16:08:03
@peter-lustig:matrix.orgpeter-lustigi will first test the fake values now16:08:03
@peter-lustig:matrix.orgpeter-lustigbecause what i really wonder is why npm run build works and nix build errors out16:08:14
@lily:lily.flowersLily Fosteri mean again, the fake values will let it build, but if it's baking them in, it won't work. you could put real values in there but then you'd have world-readable secrets16:08:26

Show newer messages


Back to Room ListRoom Version: 6