Skip to content

Commit 7ad9b48

Browse files
authored
Merge pull request #434 from nix-community/add-back-interpolate
dev-workflow: setup gcroots_dir to use the current user one
2 parents 0c69948 + c771fcb commit 7ad9b48

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/master.cfg.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
NixConfigurator,
44
BuildbotNixConfig,
55
)
6+
import getpass
67
from buildbot.plugins import util
78
from buildbot.process.factory import BuildFactory
89

@@ -11,6 +12,14 @@
1112
STATE_DIR = Path(".")
1213
PORT = 8012
1314
url = f"http://localhost:{PORT}"
15+
current_user = getpass.getuser()
16+
gcroots_dir = Path("/nix/var/nix/gcroots/per-user/") / current_user
17+
if not gcroots_dir.exists():
18+
raise RuntimeError(
19+
f"GC roots directory {gcroots_dir} does not exist. "
20+
"Please ensure that the Nix daemon is running and that you have the correct permissions."
21+
f" You can create it with `sudo mkdir -p {gcroots_dir}` and `sudo chown {current_user} {gcroots_dir}`."
22+
)
1423

1524
buildbot_nix_config = BuildbotNixConfig(
1625
db_url="sqlite:///state.sqlite",
@@ -31,6 +40,7 @@
3140
domain="localhost",
3241
webhook_base_url=url,
3342
url=url,
43+
gcroots_dir=gcroots_dir,
3444
admins=["admin"],
3545
)
3646

0 commit comments

Comments
 (0)