From f05513f3af282cdbb7c79fbce78dfcd6a1b2334e Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:22:26 -0500 Subject: [PATCH 01/14] nixos/xonsh: support extra packages --- .../manual/release-notes/rl-2505.section.md | 2 ++ nixos/modules/programs/xonsh.nix | 21 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index d5549ef98bee..b72db6032de2 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -348,6 +348,8 @@ - `borgmatic` has been updated from 1.8.14 to 1.9.5, please check the [upstream changelog](https://projects.torsion.org/borgmatic-collective/borgmatic/releases) for more details, especially for a few possibly breaking changes noted in the [1.9.0 changelog](https://projects.torsion.org/borgmatic-collective/borgmatic/releases/tag/1.9.0). +- `programs.xonsh.package` now gets overrided internally with `extraPackages` to support `programs.xonsh.extraPackages`. See `programs.xonsh.extraPackages` for more details. + - `nodePackages.ganache` has been removed, as the package has been deprecated by upstream. - `virtualisation.azure.agent` option provided by `azure-agent.nix` is replaced by `services.waagent`, and will be removed in a future release. diff --git a/nixos/modules/programs/xonsh.nix b/nixos/modules/programs/xonsh.nix index 86bdb4088845..ed7f3593d79d 100644 --- a/nixos/modules/programs/xonsh.nix +++ b/nixos/modules/programs/xonsh.nix @@ -5,7 +5,7 @@ let cfg = config.programs.xonsh; - + package = cfg.package.override { inherit (cfg) extraPackages; }; in { @@ -32,6 +32,21 @@ in type = lib.types.lines; }; + extraPackages = lib.mkOption { + default = (ps: [ ]); + type = with lib.types; coercedTo (listOf lib.types.package) (v: (_: v)) (functionTo (listOf lib.types.package)); + description = '' + Add the specified extra packages to the xonsh package. + Preferred over using `programs.xonsh.package` as it composes with `programs.xonsh.xontribs`. + + Take care in using this option along with manually defining the package + option above, as the two can result in conflicting sets of build dependencies. + This option assumes that the package option has an overridable argument + called `extraPackages`, so if you override the package option but also + intend to use this option, be sure that your resulting package still honors + the necessary option. + ''; + }; }; }; @@ -64,11 +79,11 @@ in ${cfg.config} ''; - environment.systemPackages = [ cfg.package ]; + environment.systemPackages = [ package ]; environment.shells = [ "/run/current-system/sw/bin/xonsh" - "${lib.getExe cfg.package}" + "${lib.getExe package}" ]; }; } From f6706283e81d05a907d5ca00539f8bd454a66a84 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:23:55 -0500 Subject: [PATCH 02/14] xonsh: format --- pkgs/by-name/xo/xonsh/package.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/xo/xonsh/package.nix b/pkgs/by-name/xo/xonsh/package.nix index 2cf2b9241ca4..63857655409c 100644 --- a/pkgs/by-name/xo/xonsh/package.nix +++ b/pkgs/by-name/xo/xonsh/package.nix @@ -7,14 +7,17 @@ }: let - pythonEnv = python3.withPackages - (ps: [ ps.xonsh ] ++ extraPackages ps); + pythonEnv = python3.withPackages (ps: [ ps.xonsh ] ++ extraPackages ps); xonsh = python3.pkgs.xonsh; in -runCommand - "xonsh-${xonsh.version}" +runCommand "xonsh-${xonsh.version}" { - inherit (xonsh) pname version meta passthru; + inherit (xonsh) + pname + version + meta + passthru + ; } '' mkdir -p $out/bin From a229520681acc90fd74805598fb64a698c1b2702 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Thu, 30 Jan 2025 13:22:03 -0500 Subject: [PATCH 03/14] xonsh: rewrite with callPackage and new buildPythonPackage --- pkgs/by-name/xo/xonsh/unwrapped.nix | 247 ++++++++++++++-------------- 1 file changed, 126 insertions(+), 121 deletions(-) diff --git a/pkgs/by-name/xo/xonsh/unwrapped.nix b/pkgs/by-name/xo/xonsh/unwrapped.nix index 3992262d873c..677b2f49b2d2 100644 --- a/pkgs/by-name/xo/xonsh/unwrapped.nix +++ b/pkgs/by-name/xo/xonsh/unwrapped.nix @@ -1,130 +1,135 @@ { lib, - coreutils, + buildPythonPackage, fetchFromGitHub, - gitMinimal, - glibcLocales, - nix-update-script, - pythonPackages, + + setuptools, + ply, + prompt-toolkit, + pygments, + addBinToPathHook, writableTmpDirAsHomeHook, + gitMinimal, + glibcLocales, + pip, + pyte, + pytest-mock, + pytest-subprocess, + pytestCheckHook, + requests, + + coreutils, + + nix-update-script, + python, }: -let +buildPythonPackage rec { + pname = "xonsh"; + version = "0.19.1"; + pyproject = true; - argset = { - pname = "xonsh"; - version = "0.19.1"; - pyproject = true; - - # PyPI package ships incomplete tests - src = fetchFromGitHub { - owner = "xonsh"; - repo = "xonsh"; - tag = argset.version; - hash = "sha256-20egNKlJjJO1wdy1anApz0ADBnaHPUSqhfrsPe3QQIs="; - }; - - nativeBuildInputs = with pythonPackages; [ - setuptools - wheel - ]; - - propagatedBuildInputs = ( - with pythonPackages; - [ - ply - prompt-toolkit - pygments - ] - ); - - nativeCheckInputs = - [ - addBinToPathHook - gitMinimal - glibcLocales - writableTmpDirAsHomeHook - ] - ++ (with pythonPackages; [ - pip - pyte - pytest-mock - pytest-subprocess - pytestCheckHook - requests - ]); - - disabledTests = [ - # fails on sandbox - "test_colorize_file" - "test_loading_correctly" - "test_no_command_path_completion" - "test_bsd_man_page_completions" - "test_xonsh_activator" - - # fails on non-interactive shells - "test_capture_always" - "test_casting" - "test_command_pipeline_capture" - "test_dirty_working_directory" - "test_man_completion" - "test_vc_get_branch" - "test_bash_and_is_alias_is_only_functional_alias" - - # flaky tests - "test_script" - "test_alias_stability" - "test_alias_stability_exception" - "test_complete_import" - "test_subproc_output_format" - - # https://github.com/xonsh/xonsh/issues/5569 - "test_spec_decorator_alias_output_format" - - # Broken test - "test_repath_backslash" - ]; - - disabledTestPaths = [ - # fails on sandbox - "tests/completers/test_command_completers.py" - "tests/shell/test_ptk_highlight.py" - # fails on non-interactive shells - "tests/prompt/test_gitstatus.py" - "tests/completers/test_bash_completer.py" - ]; - - # https://github.com/NixOS/nixpkgs/issues/248978 - dontWrapPythonPrograms = true; - - env.LC_ALL = "en_US.UTF-8"; - - postPatch = '' - sed -i -e 's|/bin/ls|${lib.getExe' coreutils "ls"}|' tests/test_execer.py - sed -i -e 's|SHELL=xonsh|SHELL=$out/bin/xonsh|' tests/test_integrations.py - - for script in tests/test_integrations.py scripts/xon.sh $(find -name "*.xsh"); do - sed -i -e 's|/usr/bin/env|${lib.getExe' coreutils "env"}|' $script - done - patchShebangs . - ''; - - passthru = { - shellPath = "/bin/xonsh"; - python = pythonPackages.python; # To the wrapper - wrapper = throw "The top-level xonsh package is now wrapped. Use it directly."; - updateScript = nix-update-script { }; - }; - - meta = { - homepage = "https://xon.sh/"; - description = "Python-ish, BASHwards-compatible shell"; - changelog = "https://github.com/xonsh/xonsh/raw/main/CHANGELOG.rst"; - license = with lib.licenses; [ bsd3 ]; - mainProgram = "xonsh"; - maintainers = with lib.maintainers; [ samlukeyes123 ]; - }; + # PyPI package ships incomplete tests + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xonsh"; + tag = version; + hash = "sha256-20egNKlJjJO1wdy1anApz0ADBnaHPUSqhfrsPe3QQIs="; }; -in -pythonPackages.buildPythonPackage argset + + build-system = [ + setuptools + ]; + + dependencies = [ + ply + prompt-toolkit + pygments + ]; + + nativeCheckInputs = [ + addBinToPathHook + writableTmpDirAsHomeHook + gitMinimal + glibcLocales + pip + pyte + pytest-mock + pytest-subprocess + pytestCheckHook + requests + ]; + + disabledTests = [ + # fails on sandbox + "test_bsd_man_page_completions" + "test_colorize_file" + "test_loading_correctly" + "test_no_command_path_completion" + "test_xonsh_activator" + + # fails on non-interactive shells + "test_bash_and_is_alias_is_only_functional_alias" + "test_capture_always" + "test_casting" + "test_command_pipeline_capture" + "test_dirty_working_directory" + "test_man_completion" + "test_vc_get_branch" + + # flaky tests + "test_alias_stability" + "test_alias_stability_exception" + "test_complete_import" + "test_script" + "test_subproc_output_format" + + # broken tests + "test_repath_backslash" + + # https://github.com/xonsh/xonsh/issues/5569 + "test_spec_decorator_alias_output_format" + ]; + + disabledTestPaths = [ + # fails on sandbox + "tests/completers/test_command_completers.py" + "tests/shell/test_ptk_highlight.py" + + # fails on non-interactive shells + "tests/prompt/test_gitstatus.py" + "tests/completers/test_bash_completer.py" + ]; + + # https://github.com/NixOS/nixpkgs/issues/248978 + dontWrapPythonPrograms = true; + + env.LC_ALL = "en_US.UTF-8"; + + postPatch = '' + sed -i -e 's|/bin/ls|${lib.getExe' coreutils "ls"}|' tests/test_execer.py + sed -i -e 's|SHELL=xonsh|SHELL=$out/bin/xonsh|' tests/test_integrations.py + + for script in tests/test_integrations.py scripts/xon.sh $(find -name "*.xsh"); do + sed -i -e 's|/usr/bin/env|${lib.getExe' coreutils "env"}|' $script + done + patchShebangs . + ''; + + passthru = { + inherit python; + shellPath = "/bin/xonsh"; + wrapper = throw "The top-level xonsh package is now wrapped. Use it directly."; + updateScript = nix-update-script { }; + }; + + meta = { + homepage = "https://xon.sh/"; + description = "Python-ish, BASHwards-compatible shell"; + changelog = "https://github.com/xonsh/xonsh/raw/main/CHANGELOG.rst"; + license = with lib.licenses; [ bsd3 ]; + mainProgram = "xonsh"; + maintainers = with lib.maintainers; [ samlukeyes123 ]; + }; +} From c922aecbc36187a48b82a57316c56c1f6e16f5f5 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:25:40 -0500 Subject: [PATCH 04/14] xonsh.xontribs: init empty package set --- pkgs/by-name/xo/xonsh/unwrapped.nix | 2 ++ pkgs/by-name/xo/xonsh/xontribs/default.nix | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/default.nix diff --git a/pkgs/by-name/xo/xonsh/unwrapped.nix b/pkgs/by-name/xo/xonsh/unwrapped.nix index 677b2f49b2d2..3e7686d340c2 100644 --- a/pkgs/by-name/xo/xonsh/unwrapped.nix +++ b/pkgs/by-name/xo/xonsh/unwrapped.nix @@ -23,6 +23,7 @@ nix-update-script, python, + callPackage, }: buildPythonPackage rec { @@ -122,6 +123,7 @@ buildPythonPackage rec { shellPath = "/bin/xonsh"; wrapper = throw "The top-level xonsh package is now wrapped. Use it directly."; updateScript = nix-update-script { }; + xontribs = import ./xontribs { inherit callPackage; }; }; meta = { diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix new file mode 100644 index 000000000000..162a5bdf52f4 --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -0,0 +1,5 @@ +{ + callPackage, +}: +{ +} From 92a755c010899f094f3140cae1bc5e3a5d0d17d8 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:28:29 -0500 Subject: [PATCH 05/14] xonsh.xontribs.xonsh-direnv: init at 1.6.5 --- pkgs/by-name/xo/xonsh/xontribs/default.nix | 1 + .../xonsh/xontribs/xonsh-direnv/default.nix | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/xonsh-direnv/default.nix diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix index 162a5bdf52f4..db2719a2b8b8 100644 --- a/pkgs/by-name/xo/xonsh/xontribs/default.nix +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -2,4 +2,5 @@ callPackage, }: { + xonsh-direnv = callPackage ./xonsh-direnv { }; } diff --git a/pkgs/by-name/xo/xonsh/xontribs/xonsh-direnv/default.nix b/pkgs/by-name/xo/xonsh/xontribs/xonsh-direnv/default.nix new file mode 100644 index 000000000000..e4122feb09fe --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/xonsh-direnv/default.nix @@ -0,0 +1,39 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + setuptools, + direnv, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "xonsh-direnv"; + version = "1.6.5"; + + src = fetchFromGitHub { + owner = "74th"; + repo = "xonsh-direnv"; + tag = version; + hash = "sha256-huBJ7WknVCk+WgZaXHlL+Y1sqsn6TYqMP29/fsUPSyU="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + direnv + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Direnv support for Xonsh"; + homepage = "https://github.com/74th/xonsh-direnv/"; + changelog = "https://github.com/74th/xonsh-direnv/releases/tag/${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ greg ]; + }; +} From e23facf8739d9738c6904e0475b08ef735714bb5 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:30:32 -0500 Subject: [PATCH 06/14] xonsh.xontribs.xontrib-abbrevs: init at 0.1.0 --- pkgs/by-name/xo/xonsh/xontribs/default.nix | 1 + .../xontribs/xontrib-abbrevs/default.nix | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/xontrib-abbrevs/default.nix diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix index db2719a2b8b8..c40e2c67412c 100644 --- a/pkgs/by-name/xo/xonsh/xontribs/default.nix +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -3,4 +3,5 @@ }: { xonsh-direnv = callPackage ./xonsh-direnv { }; + xontrib-abbrevs = callPackage ./xontrib-abbrevs { }; } diff --git a/pkgs/by-name/xo/xonsh/xontribs/xontrib-abbrevs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/xontrib-abbrevs/default.nix new file mode 100644 index 000000000000..d276a84fbf9c --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/xontrib-abbrevs/default.nix @@ -0,0 +1,58 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + setuptools, + setuptools-scm, + poetry-core, + prompt-toolkit, + writableTmpDirAsHomeHook, + pytestCheckHook, + xonsh, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "xontrib-abbrevs"; + version = "0.1.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xontrib-abbrevs"; + tag = "v${version}"; + hash = "sha256-JxH5b2ey99tvHXSUreU5r6fS8nko4RrS/1c8psNbJNc="; + }; + + prePatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"xonsh>=0.17", ' "" + ''; + + build-system = [ + setuptools + setuptools-scm + poetry-core + ]; + + dependencies = [ + prompt-toolkit + ]; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + pytestCheckHook + xonsh + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Command abbreviations for Xonsh"; + homepage = "https://github.com/xonsh/xontrib-abbrevs"; + changelog = "https://github.com/xonsh/xontrib-apprevs/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ greg ]; + }; +} From 9c6b94bb313be8c4ce4c7ce7bb19cb916aa3e0f7 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:31:04 -0500 Subject: [PATCH 07/14] xonsh.xontribs.xontrib-bashisms: init at 0.0.5 --- pkgs/by-name/xo/xonsh/xontribs/default.nix | 1 + .../xontribs/xontrib-bashisms/default.nix | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/xontrib-bashisms/default.nix diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix index c40e2c67412c..57b19bd769bd 100644 --- a/pkgs/by-name/xo/xonsh/xontribs/default.nix +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -4,4 +4,5 @@ { xonsh-direnv = callPackage ./xonsh-direnv { }; xontrib-abbrevs = callPackage ./xontrib-abbrevs { }; + xontrib-bashisms = callPackage ./xontrib-bashisms { }; } diff --git a/pkgs/by-name/xo/xonsh/xontribs/xontrib-bashisms/default.nix b/pkgs/by-name/xo/xonsh/xontribs/xontrib-bashisms/default.nix new file mode 100644 index 000000000000..9247a1f225a4 --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/xontrib-bashisms/default.nix @@ -0,0 +1,48 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + setuptools, + writableTmpDirAsHomeHook, + pytestCheckHook, + xonsh, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "xontrib-bashisms"; + version = "0.0.5"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xontrib-bashisms"; + tag = version; + hash = "sha256-R1DCGMrRCJLnz/QMk6QB8ai4nx88vvyPdaCKg3od5/I="; + }; + + prePatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"xonsh>=0.12.5"' "" + ''; + + build-system = [ + setuptools + ]; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + pytestCheckHook + xonsh + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Bash-like interactive mode extensions for the xonsh shell"; + homepage = "https://github.com/xonsh/xontrib-bashisms"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ greg ]; + }; +} From bc10963f94090f17eaa1400d61087842dfd0fefb Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:31:40 -0500 Subject: [PATCH 08/14] xonsh.xontribs.xontrib-debug-tools: init at 0.0.1 --- pkgs/by-name/xo/xonsh/xontribs/default.nix | 1 + .../xontribs/xontrib-debug-tools/default.nix | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/xontrib-debug-tools/default.nix diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix index 57b19bd769bd..d2b54e0de446 100644 --- a/pkgs/by-name/xo/xonsh/xontribs/default.nix +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -5,4 +5,5 @@ xonsh-direnv = callPackage ./xonsh-direnv { }; xontrib-abbrevs = callPackage ./xontrib-abbrevs { }; xontrib-bashisms = callPackage ./xontrib-bashisms { }; + xontrib-debug-tools = callPackage ./xontrib-debug-tools { }; } diff --git a/pkgs/by-name/xo/xonsh/xontribs/xontrib-debug-tools/default.nix b/pkgs/by-name/xo/xonsh/xontribs/xontrib-debug-tools/default.nix new file mode 100644 index 000000000000..dbe3e01a7961 --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/xontrib-debug-tools/default.nix @@ -0,0 +1,48 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + setuptools, + writableTmpDirAsHomeHook, + pytestCheckHook, + xonsh, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "xontrib-debug-tools"; + version = "0.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xontrib-debug-tools"; + tag = version; + hash = "sha256-Z8AXKk94NxmF5rO2OMZzNX0GIP/Vj+mOtYUaifRX1cw="; + }; + + prePatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"xonsh>=0.12.5"' "" + ''; + + build-system = [ + setuptools + ]; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + pytestCheckHook + xonsh + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Debug tools for xonsh shell"; + homepage = "https://github.com/xonsh/xontrib-debug-tools"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ greg ]; + }; +} From d508833e365603020eafd4265b90c6b8bf3b5b8e Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:32:08 -0500 Subject: [PATCH 09/14] xonsh.xontribs.xontrib-distributed: init at 0.0.4 --- pkgs/by-name/xo/xonsh/xontribs/default.nix | 1 + .../xontribs/xontrib-distributed/default.nix | 56 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/xontrib-distributed/default.nix diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix index d2b54e0de446..64e84a357fa8 100644 --- a/pkgs/by-name/xo/xonsh/xontribs/default.nix +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -6,4 +6,5 @@ xontrib-abbrevs = callPackage ./xontrib-abbrevs { }; xontrib-bashisms = callPackage ./xontrib-bashisms { }; xontrib-debug-tools = callPackage ./xontrib-debug-tools { }; + xontrib-distributed = callPackage ./xontrib-distributed { }; } diff --git a/pkgs/by-name/xo/xonsh/xontribs/xontrib-distributed/default.nix b/pkgs/by-name/xo/xonsh/xontribs/xontrib-distributed/default.nix new file mode 100644 index 000000000000..7ae42069f366 --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/xontrib-distributed/default.nix @@ -0,0 +1,56 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + poetry-core, + distributed, + writableTmpDirAsHomeHook, + pytestCheckHook, + xonsh, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "xontrib-distributed"; + version = "0.0.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xontrib-distributed"; + tag = "v${version}"; + hash = "sha256-Hb7S3PqHi0w6zb9ki8ADMtgdYVv8O5WQZMgJzKF74qE="; + }; + + prePatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'xonsh = ">=0.12"' "" + ''; + + build-system = [ + poetry-core + ]; + + dependencies = [ + distributed + ]; + + # As of v0.0.4 has no tests that get run by pytest + doCheck = false; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + pytestCheckHook + xonsh + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Dask Distributed integration for Xonsh"; + homepage = "https://github.com/xonsh/xontrib-distributed"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ greg ]; + }; +} From cb78105719eabede7c07206e6c8ac8fca3539e88 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:32:43 -0500 Subject: [PATCH 10/14] xonsh.xontribs.xontrib-fish-completer: init at 0.0.1 --- pkgs/by-name/xo/xonsh/xontribs/default.nix | 1 + .../xontrib-fish-completer/default.nix | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/xontrib-fish-completer/default.nix diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix index 64e84a357fa8..4d06e9dd5039 100644 --- a/pkgs/by-name/xo/xonsh/xontribs/default.nix +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -7,4 +7,5 @@ xontrib-bashisms = callPackage ./xontrib-bashisms { }; xontrib-debug-tools = callPackage ./xontrib-debug-tools { }; xontrib-distributed = callPackage ./xontrib-distributed { }; + xontrib-fish-completer = callPackage ./xontrib-fish-completer { }; } diff --git a/pkgs/by-name/xo/xonsh/xontribs/xontrib-fish-completer/default.nix b/pkgs/by-name/xo/xonsh/xontribs/xontrib-fish-completer/default.nix new file mode 100644 index 000000000000..71a9beacaf82 --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/xontrib-fish-completer/default.nix @@ -0,0 +1,50 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + setuptools, + writableTmpDirAsHomeHook, + pytestCheckHook, + pytest-subprocess, + xonsh, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "xontrib-fish-completer"; + version = "0.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xontrib-fish-completer"; + tag = version; + hash = "sha256-PhhdZ3iLPDEIG9uDeR5ctJ9zz2+YORHBhbsiLrJckyA="; + }; + + prePatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"xonsh>=0.12.5"' "" + ''; + + build-system = [ + setuptools + ]; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + pytestCheckHook + pytest-subprocess + xonsh + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Populate rich completions using fish and remove the default bash based completer"; + homepage = "https://github.com/xonsh/xontrib-fish-completer"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ greg ]; + }; +} From afeae08331f80ee83959223803bea28ae6bc0b72 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:33:06 -0500 Subject: [PATCH 11/14] xonsh.xontribs.xontrib-jedi: init at 0.1.1 --- pkgs/by-name/xo/xonsh/xontribs/default.nix | 1 + .../xonsh/xontribs/xontrib-jedi/default.nix | 59 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/xontrib-jedi/default.nix diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix index 4d06e9dd5039..d8464131eee2 100644 --- a/pkgs/by-name/xo/xonsh/xontribs/default.nix +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -8,4 +8,5 @@ xontrib-debug-tools = callPackage ./xontrib-debug-tools { }; xontrib-distributed = callPackage ./xontrib-distributed { }; xontrib-fish-completer = callPackage ./xontrib-fish-completer { }; + xontrib-jedi = callPackage ./xontrib-jedi { }; } diff --git a/pkgs/by-name/xo/xonsh/xontribs/xontrib-jedi/default.nix b/pkgs/by-name/xo/xonsh/xontribs/xontrib-jedi/default.nix new file mode 100644 index 000000000000..a6ae8f5e23dd --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/xontrib-jedi/default.nix @@ -0,0 +1,59 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + poetry-core, + jedi, + writableTmpDirAsHomeHook, + pytestCheckHook, + xonsh, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "xontrib-jedi"; + version = "0.1.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xontrib-jedi"; + tag = "v${version}"; + hash = "sha256-T4Yxr91emM2mjclQOjQsnnPO/JijAGNcqmZjxrz72Bs="; + }; + + prePatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'xonsh = ">=0.17"' "" + ''; + + build-system = [ + poetry-core + ]; + + dependencies = [ + jedi + ]; + + preCheck = '' + substituteInPlace tests/test_jedi.py \ + --replace-fail "/usr/bin" "${jedi}/bin" + ''; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + pytestCheckHook + xonsh + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Xonsh Python mode completions using jedi"; + homepage = "https://github.com/xonsh/xontrib-jedi"; + changelog = "https://github.com/xonsh/xontrib-jedi.releases/tag/${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ greg ]; + }; +} From 6453547e820676c7eb0d3d7debdd4f2bb7093bd4 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:33:24 -0500 Subject: [PATCH 12/14] xonsh.xontribs.xontrib-jupyter: init at 0.3.2 --- pkgs/by-name/xo/xonsh/xontribs/default.nix | 1 + .../xontribs/xontrib-jupyter/default.nix | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/xontrib-jupyter/default.nix diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix index d8464131eee2..0ad20b9cbab8 100644 --- a/pkgs/by-name/xo/xonsh/xontribs/default.nix +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -9,4 +9,5 @@ xontrib-distributed = callPackage ./xontrib-distributed { }; xontrib-fish-completer = callPackage ./xontrib-fish-completer { }; xontrib-jedi = callPackage ./xontrib-jedi { }; + xontrib-jupyter = callPackage ./xontrib-jupyter { }; } diff --git a/pkgs/by-name/xo/xonsh/xontribs/xontrib-jupyter/default.nix b/pkgs/by-name/xo/xonsh/xontribs/xontrib-jupyter/default.nix new file mode 100644 index 000000000000..a4ff04bba4e2 --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/xontrib-jupyter/default.nix @@ -0,0 +1,57 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + poetry-core, + jupyter-client, + writableTmpDirAsHomeHook, + pytestCheckHook, + xonsh, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "xontrib-jupyter"; + version = "0.3.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xontrib-jupyter"; + tag = "v${version}"; + hash = "sha256-gf+jyA2il7MD+Moez/zBYpf4EaPiNcgr5ZrJFK4uD2k="; + }; + + prePatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'xonsh = ">=0.12"' "" + + substituteInPlace xonsh_jupyter/shell.py \ + --replace-fail 'xonsh.base_shell' 'xonsh.shells.base_shell' + ''; + + build-system = [ + poetry-core + ]; + + dependencies = [ + jupyter-client + ]; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + pytestCheckHook + xonsh + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Xonsh jupyter kernel allows to run Xonsh shell code in Jupyter, JupyterLab, Euporia, etc"; + homepage = "https://github.com/xonsh/xontrib-jupyter"; + changelog = "https://github.com/xonsh/xontrib-jupyter/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ greg ]; + }; +} From a09d941ad719afe76c1924dcd95127d1dafc777b Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:33:39 -0500 Subject: [PATCH 13/14] xonsh.xontribs.xontrib-vox: init at 0.0.1 --- pkgs/by-name/xo/xonsh/xontribs/default.nix | 1 + .../xo/xonsh/xontribs/xontrib-vox/default.nix | 60 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/xontrib-vox/default.nix diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix index 0ad20b9cbab8..38e1a697f36f 100644 --- a/pkgs/by-name/xo/xonsh/xontribs/default.nix +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -10,4 +10,5 @@ xontrib-fish-completer = callPackage ./xontrib-fish-completer { }; xontrib-jedi = callPackage ./xontrib-jedi { }; xontrib-jupyter = callPackage ./xontrib-jupyter { }; + xontrib-vox = callPackage ./xontrib-vox { }; } diff --git a/pkgs/by-name/xo/xonsh/xontribs/xontrib-vox/default.nix b/pkgs/by-name/xo/xonsh/xontribs/xontrib-vox/default.nix new file mode 100644 index 000000000000..9a191be8e5cf --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/xontrib-vox/default.nix @@ -0,0 +1,60 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + setuptools, + virtualenv, + writableTmpDirAsHomeHook, + pytestCheckHook, + pytest-subprocess, + xonsh, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "xontrib-vox"; + version = "0.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xontrib-vox"; + tag = version; + hash = "sha256-OB1O5GZYkg7Ucaqak3MncnQWXhMD4BM4wXsYCDD0mhk="; + }; + + prePatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"xonsh>=0.12.5"' "" + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ + virtualenv + ]; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + pytestCheckHook + pytest-subprocess + xonsh + ]; + + disabledTests = [ + # Monkeypatch in test fails, preventing test from running + "test_interpreter" + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Python virtual environment manager for the xonsh shell"; + homepage = "https://github.com/xonsh/xontrib-vox"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ greg ]; + }; +} From 65fa4335a0c93be788831b30cf0b161e3c46cc21 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 12 Nov 2024 09:33:54 -0500 Subject: [PATCH 14/14] xonsh.xontribs.xontrib-whole-word-jumping: init at 0.0.1 --- pkgs/by-name/xo/xonsh/xontribs/default.nix | 1 + .../xontrib-whole-word-jumping/default.nix | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 pkgs/by-name/xo/xonsh/xontribs/xontrib-whole-word-jumping/default.nix diff --git a/pkgs/by-name/xo/xonsh/xontribs/default.nix b/pkgs/by-name/xo/xonsh/xontribs/default.nix index 38e1a697f36f..fd0b211e6d7b 100644 --- a/pkgs/by-name/xo/xonsh/xontribs/default.nix +++ b/pkgs/by-name/xo/xonsh/xontribs/default.nix @@ -11,4 +11,5 @@ xontrib-jedi = callPackage ./xontrib-jedi { }; xontrib-jupyter = callPackage ./xontrib-jupyter { }; xontrib-vox = callPackage ./xontrib-vox { }; + xontrib-whole-word-jumping = callPackage ./xontrib-whole-word-jumping { }; } diff --git a/pkgs/by-name/xo/xonsh/xontribs/xontrib-whole-word-jumping/default.nix b/pkgs/by-name/xo/xonsh/xontribs/xontrib-whole-word-jumping/default.nix new file mode 100644 index 000000000000..d842525e899f --- /dev/null +++ b/pkgs/by-name/xo/xonsh/xontribs/xontrib-whole-word-jumping/default.nix @@ -0,0 +1,48 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + setuptools, + writableTmpDirAsHomeHook, + pytestCheckHook, + xonsh, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "xontrib-whole-word-jumping"; + version = "0.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xontrib-whole-word-jumping"; + tag = version; + hash = "sha256-zLAOGW9prjYDQBDITFNMggn4X1JTyAnVdjkBOH9gXPs="; + }; + + prePatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"xonsh>=0.12.5", ' "" + ''; + + build-system = [ + setuptools + ]; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + pytestCheckHook + xonsh + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Additional keyboard navigation for interactive xonsh shells"; + homepage = "https://github.com/xonsh/xontrib-whole-word-jumping"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ greg ]; + }; +}