Skip to content

Commit 2981c89

Browse files
committed
Update python script for new syntax
1 parent 5e2c7b9 commit 2981c89

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

nur/update.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
from enum import Enum, auto
1818
from urllib.parse import urlparse, urljoin, ParseResult
1919

20-
ROOT = Path(__file__).parent.parent
20+
ROOT = Path(__file__).parent.parent.resolve();
2121
LOCK_PATH = ROOT.joinpath("repos.json.lock")
2222
MANIFEST_PATH = ROOT.joinpath("repos.json")
23+
EVALREPO_PATH = ROOT.joinpath("lib/evalRepo.nix")
2324

2425
Url = ParseResult
2526

@@ -214,7 +215,11 @@ def eval_repo(spec: RepoSpec, repo_path: Path) -> None:
214215
with open(eval_path, "w") as f:
215216
f.write(f"""
216217
with import <nixpkgs> {{}};
217-
callPackages {repo_path.joinpath(spec.nix_file)} {{}}
218+
import {EVALREPO_PATH} {{
219+
name = "{spec.name}";
220+
src = {repo_path.joinpath(spec.nix_file)};
221+
inherit pkgs lib;
222+
}}
218223
""")
219224

220225
cmd = [
@@ -229,6 +234,7 @@ def eval_repo(spec: RepoSpec, repo_path: Path) -> None:
229234
"-I", f"nixpkgs={nixpkgs_path()}",
230235
"-I", str(repo_path),
231236
"-I", str(eval_path),
237+
"-I", str(EVALREPO_PATH),
232238
] # yapf: disable
233239

234240
print(f"$ {' '.join(cmd)}")

0 commit comments

Comments
 (0)