Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lock: Extend environment instead of replacing it #836

Merged
merged 1 commit into from
Jan 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/dream2nix/core/lock/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
refresh' = config.deps.writePython3Bin "refresh" {} ''
import tempfile
import subprocess
import os
import json
from pathlib import Path

Expand All @@ -55,9 +56,11 @@

def run_refresh_script(script):
with tempfile.NamedTemporaryFile() as out_file:
env = os.environ.copy()
env["out"] = out_file.name
subprocess.run(
[script],
check=True, shell=True, env={"out": out_file.name})
check=True, shell=True, env=env)
# open the file again via its name (it might have been replaced)
with open(out_file.name) as out:
return json.load(out)
Expand Down