From 5aaa5f5e75b3795e8f40d18dce211f50cceb6693 Mon Sep 17 00:00:00 2001 From: figsoda Date: Thu, 11 Nov 2021 13:39:35 -0500 Subject: [PATCH] pluginupdate.py: fix compatibility with nix 2.4 --- maintainers/scripts/pluginupdate.py | 2 +- .../editors/kakoune/plugins/update-shell.nix | 15 +++++++++++++++ .../editors/kakoune/plugins/update.py | 2 +- pkgs/misc/vim-plugins/update-shell.nix | 11 ++++++----- 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 pkgs/applications/editors/kakoune/plugins/update-shell.nix diff --git a/maintainers/scripts/pluginupdate.py b/maintainers/scripts/pluginupdate.py index 2a9a2d4c0a23..2c2cb3b6dd36 100644 --- a/maintainers/scripts/pluginupdate.py +++ b/maintainers/scripts/pluginupdate.py @@ -305,7 +305,7 @@ class CleanEnvironment(object): def get_current_plugins(editor: Editor) -> List[Plugin]: with CleanEnvironment(): - cmd = ["nix", "eval", "--json", editor.get_plugins] + cmd = ["nix", "eval", "--impure", "--json", "--expr", editor.get_plugins] log.debug("Running command %s", cmd) out = subprocess.check_output(cmd) data = json.loads(out) diff --git a/pkgs/applications/editors/kakoune/plugins/update-shell.nix b/pkgs/applications/editors/kakoune/plugins/update-shell.nix new file mode 100644 index 000000000000..ca83f09c7154 --- /dev/null +++ b/pkgs/applications/editors/kakoune/plugins/update-shell.nix @@ -0,0 +1,15 @@ +{ pkgs ? import ../../../../.. { } }: + +with pkgs; +let + pyEnv = python3.withPackages (ps: [ ps.GitPython ]); +in + +mkShell { + packages = [ + bash + pyEnv + nix + nix-prefetch-scripts + ]; +} diff --git a/pkgs/applications/editors/kakoune/plugins/update.py b/pkgs/applications/editors/kakoune/plugins/update.py index 40a28d9afe2c..9f5f64f9e5b3 100755 --- a/pkgs/applications/editors/kakoune/plugins/update.py +++ b/pkgs/applications/editors/kakoune/plugins/update.py @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell -p nix-prefetch-git -p python3 -p python3Packages.GitPython nix -i python3 +#!nix-shell update-shell.nix -i python3 # format: # $ nix run nixpkgs.python3Packages.black -c black update.py diff --git a/pkgs/misc/vim-plugins/update-shell.nix b/pkgs/misc/vim-plugins/update-shell.nix index 18b5b1a37c5f..e1b727c49e04 100644 --- a/pkgs/misc/vim-plugins/update-shell.nix +++ b/pkgs/misc/vim-plugins/update-shell.nix @@ -1,14 +1,15 @@ -{ nixpkgs ? import ../../.. { } }: -with nixpkgs; +{ pkgs ? import ../../.. { } }: + +with pkgs; let - pyEnv = python3.withPackages(ps: [ ps.GitPython ]); + pyEnv = python3.withPackages (ps: [ ps.GitPython ]); in + mkShell { packages = [ bash pyEnv - nix_2_3 + nix nix-prefetch-scripts ]; } -