From 5bb7399937f1fa712ee686bea2e7359a0cfddd23 Mon Sep 17 00:00:00 2001 From: Jost Alemann Date: Wed, 24 Jun 2026 12:54:34 +0200 Subject: [PATCH 1/3] fish: 4.7.1 -> 4.8.0 Changelog: https://github.com/fish-shell/fish-shell/releases/tag/4.8.0 Diff: https://github.com/fish-shell/fish-shell/compare/4.7.1...4.8.0 --- pkgs/by-name/fi/fish/nix-darwin-path.patch | 16 ++++++++-------- pkgs/by-name/fi/fish/package.nix | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/fi/fish/nix-darwin-path.patch b/pkgs/by-name/fi/fish/nix-darwin-path.patch index 8e92dcf1e9ce..cca5b1ccd81d 100644 --- a/pkgs/by-name/fi/fish/nix-darwin-path.patch +++ b/pkgs/by-name/fi/fish/nix-darwin-path.patch @@ -1,12 +1,12 @@ diff --git a/share/config.fish b/share/config.fish -index 73148ac25..1964e30be 100644 +index b246916a5..05252c35f 100644 --- a/share/config.fish +++ b/share/config.fish -@@ -175,6 +175,7 @@ and __fish_set_locale +@@ -132,6 +132,7 @@ and __fish_set_locale + # This used to be in etc/config.fish - keep it here to keep the semantics # - if status --is-login - if command -sq /usr/libexec/path_helper -+ and not set -q __NIX_DARWIN_SET_ENVIRONMENT_DONE - __fish_macos_set_env PATH /etc/paths '/etc/paths.d' - if test -n "$MANPATH" - __fish_macos_set_env MANPATH /etc/manpaths '/etc/manpaths.d' + if status is-login && command -sq /usr/libexec/path_helper ++ and not set -q __NIX_DARWIN_SET_ENVIRONMENT_DONE + __fish_macos_set_env PATH /etc/paths '/etc/paths.d' + if test -n "$MANPATH" + __fish_macos_set_env MANPATH /etc/manpaths '/etc/manpaths.d' diff --git a/pkgs/by-name/fi/fish/package.nix b/pkgs/by-name/fi/fish/package.nix index a991b9b5683c..300538248ede 100644 --- a/pkgs/by-name/fi/fish/package.nix +++ b/pkgs/by-name/fi/fish/package.nix @@ -150,13 +150,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "fish"; - version = "4.7.1"; + version = "4.8.0"; src = fetchFromGitHub { owner = "fish-shell"; repo = "fish-shell"; tag = finalAttrs.version; - hash = "sha256-u0mBdWkxP4zI6NUhJ0LJrEDrbAAfTDi8IapsWWC9yWc="; + hash = "sha256-ttjLM1uBY8sL+jVcxdHUnHYlRFe5jGjnkgBLy17qGso="; }; env = { @@ -169,7 +169,7 @@ stdenv.mkDerivation (finalAttrs: { cargoDeps = rustPlatform.fetchCargoVendor { inherit (finalAttrs) src patches; - hash = "sha256-d4YA9fnDQyfyK675nP+tiTqJ1o2jqjwPHU1trXd8MCA="; + hash = "sha256-w8MuabpZ5ronQL3iaXbLErxPlTe1Mg8OsRb5foR59II="; }; patches = [ From 1260b0727b5458aa7b69ee7cda483a2d5558316d Mon Sep 17 00:00:00 2001 From: r-vdp Date: Wed, 24 Jun 2026 13:41:57 +0200 Subject: [PATCH 2/3] nixos/fish: extract completion generator from the fish binary fish no longer installs share/fish/tools/ and instead embeds the script in the binary. Extract it via `status get-file` and replace the patch that stripped the autogenerated header with an inline sed plus a test that fails the build if the upstream header format changes. --- nixos/modules/programs/fish.nix | 46 ++++++++++++------- .../programs/fish_completion-generator.patch | 14 ------ 2 files changed, 29 insertions(+), 31 deletions(-) delete mode 100644 nixos/modules/programs/fish_completion-generator.patch diff --git a/nixos/modules/programs/fish.nix b/nixos/modules/programs/fish.nix index 86c29477ebcc..b425ed4028f1 100644 --- a/nixos/modules/programs/fish.nix +++ b/nixos/modules/programs/fish.nix @@ -262,22 +262,17 @@ in (lib.mkIf cfg.generateCompletions { etc."fish/generated_completions".source = let - patchedGenerator = pkgs.stdenv.mkDerivation { - name = "fish_patched-completion-generator"; - srcs = [ - "${cfg.package}/share/fish/tools/create_manpage_completions.py" - ]; - unpackCmd = "cp $curSrc $(basename $curSrc)"; - sourceRoot = "."; - patches = [ ./fish_completion-generator.patch ]; # to prevent collisions of identical completion files - dontBuild = true; - installPhase = '' - mkdir -p $out - cp * $out/ - ''; - preferLocalBuild = true; - allowSubstitutes = false; - }; + # fish embeds the generator script in the binary, so extract it. + generator = + pkgs.runCommandLocal "fish_completion-generator" + { + nativeBuildInputs = [ cfg.package ]; + } + '' + mkdir -p $out + fish --no-config -c 'status get-file tools/create_manpage_completions.py' \ + > $out/create_manpage_completions.py + ''; generateCompletions = package: pkgs.runCommandLocal @@ -298,8 +293,25 @@ in '' mkdir -p $out if [ -d $package/share/man ]; then - find -L $package/share/man -type f | xargs ${pkgs.python3.pythonOnBuildForHost.interpreter} ${patchedGenerator}/create_manpage_completions.py --directory $out >/dev/null + find -L $package/share/man -type f \ + | xargs ${pkgs.python3.pythonOnBuildForHost.interpreter} \ + ${generator}/create_manpage_completions.py --directory $out \ + >/dev/null fi + + # The generator emits a header comment containing the man page store + # path. Strip it so identical completions from different packages + # don't collide and so we don't retain runtime references to the + # inputs. Fail if generated files lack the expected header so that a + # change in the upstream format gets noticed. + shopt -s nullglob + for f in $out/*.fish; do + if ! grep -q '^# Autogenerated from ' "$f"; then + echo "error: expected '# Autogenerated from' header not found in $f" >&2 + exit 1 + fi + sed -i '/^# Autogenerated from /d' "$f" + done ''; packages = if diff --git a/nixos/modules/programs/fish_completion-generator.patch b/nixos/modules/programs/fish_completion-generator.patch deleted file mode 100644 index fa207e484c99..000000000000 --- a/nixos/modules/programs/fish_completion-generator.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/create_manpage_completions.py -+++ b/create_manpage_completions.py -@@ -879,10 +879,6 @@ def parse_manpage_at_path(manpage_path, output_directory): - ) - return False - -- # Output the magic word Autogenerated so we can tell if we can overwrite this -- built_command_output.insert( -- 0, "# " + CMDNAME + "\n# Autogenerated from man page " + manpage_path -- ) - # built_command_output.insert(2, "# using " + parser.__class__.__name__) # XXX MISATTRIBUTES THE CULPABLE PARSER! Was really using Type2 but reporting TypeDeroffManParser - - for line in built_command_output: - From d69bec62c00cba506fa882e20758bc1e30180864 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Wed, 24 Jun 2026 13:41:57 +0200 Subject: [PATCH 3/3] fish: fix fishConfig test for embedded web_config share/fish/tools/ is no longer installed, so extract the embedded web_config files via `status get-file`. --- pkgs/by-name/fi/fish/package.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/fi/fish/package.nix b/pkgs/by-name/fi/fish/package.nix index 300538248ede..1aa932517d06 100644 --- a/pkgs/by-name/fi/fish/package.nix +++ b/pkgs/by-name/fi/fish/package.nix @@ -404,10 +404,17 @@ stdenv.mkDerivation (finalAttrs: { fishConfig = let fishScript = writeText "test.fish" '' - set -x __fish_bin_dir ${finalAttrs.finalPackage}/bin - echo $__fish_bin_dir - cp -r ${finalAttrs.finalPackage}/share/fish/tools/web_config/* . - chmod -R +w * + # webconfig.py locates fish via $fish_bin_dir, which fish_config + # normally exports from the read-only $__fish_bin_dir. + set -x fish_bin_dir $__fish_bin_dir + echo $fish_bin_dir + + # The web_config tool is embedded in the binary, so extract it. + for f in (status list-files tools/web_config) + mkdir -p (path dirname $f) + status get-file $f > $f + end + cd tools/web_config # if we don't set `delete=False`, the file will get cleaned up # automatically (leading the test to fail because there's no