Skip to content

Commit

Permalink
electron: fix update script
Browse files Browse the repository at this point in the history
The nix-universal-prefetch package was deleted in 578d7e7. Switch to
nurl.

Fixes NixOS#321490
  • Loading branch information
squalus committed Jul 11, 2024
1 parent 70db656 commit 210b11b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkgs/development/tools/electron/update.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env nix-shell
#! nix-shell -i python -p python3.pkgs.joblib python3.pkgs.click python3.pkgs.click-log nix nix-prefetch-git nix-universal-prefetch prefetch-yarn-deps prefetch-npm-deps
#! nix-shell -i python -p python3.pkgs.joblib python3.pkgs.click python3.pkgs.click-log nix nix-prefetch-git nurl prefetch-yarn-deps prefetch-npm-deps
"""
electron updater
Expand Down Expand Up @@ -83,6 +83,7 @@
logger = logging.getLogger(__name__)
click_log.basic_config(logger)

nixpkgs_path = os.path.dirname(os.path.realpath(__file__)) + "/../../../.."

class Repo:
fetcher: str
Expand Down Expand Up @@ -304,11 +305,11 @@ def supported_version_range() -> range:

@memory.cache
def get_repo_hash(fetcher: str, args: dict) -> str:
cmd = ["nix-universal-prefetch", fetcher]
for arg_name, arg in args.items():
cmd.append(f"--{arg_name}")
cmd.append(arg)

expr = f'with import {nixpkgs_path} {{}};{fetcher}{{'
for key, val in args.items():
expr += f'{key}="{val}";'
expr += '}'
cmd = ["nurl", "-H", "--expr", expr]
print(" ".join(cmd), file=sys.stderr)
out = subprocess.check_output(cmd)
return out.decode("utf-8").strip()
Expand Down

0 comments on commit 210b11b

Please sign in to comment.