From e92cd95bd6bcfda234cf0f0703c3d32071e54926 Mon Sep 17 00:00:00 2001 From: alsaiduq-lab Date: Fri, 14 Mar 2025 06:17:35 -0600 Subject: [PATCH] fix on setting the proper completions and sets the shell --- modules/fish.nix | 8 +++++--- pkgs/fish-rust/default.nix | 28 ++++++++++++++++++---------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/modules/fish.nix b/modules/fish.nix index 2aa680c..91e1a0b 100644 --- a/modules/fish.nix +++ b/modules/fish.nix @@ -1,12 +1,13 @@ { config, pkgs, lib, ... }: - let fish-rust = pkgs.callPackage ../pkgs/fish-rust { }; in { - programs.fish.enable = true; + programs.fish = { + enable = true; + package = fish-rust; + }; environment.systemPackages = with pkgs; [ - fish-rust starship fzf bat @@ -14,4 +15,5 @@ in fd ripgrep ]; + users.users.cobray.shell = lib.mkForce fish-rust; } diff --git a/pkgs/fish-rust/default.nix b/pkgs/fish-rust/default.nix index 4b888b2..fd9c2a2 100644 --- a/pkgs/fish-rust/default.nix +++ b/pkgs/fish-rust/default.nix @@ -1,16 +1,13 @@ -{ lib, rustPlatform, fetchgit, pkg-config, cmake, ncurses, sphinx }: - +{ lib, rustPlatform, fetchgit, ncurses, sphinx, python3 }: rustPlatform.buildRustPackage rec { pname = "fish"; - version = "unstable-2025-03-14"; - + version = "4.1-2025-03-14"; src = fetchgit { url = "https://github.com/fish-shell/fish-shell.git"; rev = "refs/heads/master"; fetchSubmodules = true; sha256 = "18zpwa3yddic6wdwj7g51w6n4apwsixfvl179yddk2nwfpxhv4hq"; }; - cargoLock = { lockFile = "${src}/Cargo.lock"; outputHashes = { @@ -18,21 +15,32 @@ rustPlatform.buildRustPackage rec { "pcre2-sys-0.2.9" = "0mhjw7fvrzxb3fd0c534a17qgy6svz0z8269d2fs6q8aw11610mr"; }; }; - - nativeBuildInputs = [ pkg-config cmake sphinx ]; buildInputs = [ ncurses ]; - + nativeBuildInputs = [ sphinx python3 ]; preBuild = '' export FISH_BUILD_VERSION="${version}" export FISH_BUILD_DOCS=1 ''; - + postInstall = '' + export HOME=$(mktemp -d) + mkdir -p $HOME/.local/share/fish/install + $out/bin/fish --install + mkdir -p $out/share/fish + cp -r $HOME/.local/share/fish/install/* $out/share/fish/ 2>/dev/null || true + mkdir -p $out/share/fish/tools + cp $src/share/tools/create_manpage_completions.py $out/share/fish/tools/ + cp $src/share/tools/deroff.py $out/share/fish/tools/ + chmod +x $out/share/fish/tools/create_manpage_completions.py + chmod +x $out/share/fish/tools/deroff.py + rm -rf $HOME + ''; doCheck = false; - meta = with lib; { description = "The user-friendly command line shell (Rust version)"; homepage = "https://fishshell.com/"; license = licenses.gpl2; platforms = platforms.unix; + mainProgram = "fish"; }; + passthru.shellPath = "/bin/fish"; }