Skip to content

Commit 270aa18

Browse files
committed
Update python script for new syntax
1 parent ee65c7a commit 270aa18

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

nur/update.py

+9-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,12 @@ 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+
url = "{spec.url}";
221+
src = {repo_path.joinpath(spec.nix_file)};
222+
inherit pkgs lib;
223+
}}
218224
""")
219225

220226
cmd = [
@@ -229,6 +235,7 @@ def eval_repo(spec: RepoSpec, repo_path: Path) -> None:
229235
"-I", f"nixpkgs={nixpkgs_path()}",
230236
"-I", str(repo_path),
231237
"-I", str(eval_path),
238+
"-I", str(EVALREPO_PATH),
232239
] # yapf: disable
233240

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

0 commit comments

Comments
 (0)