properly assigns the custom shell

This commit is contained in:
alsaiduq-lab 2025-03-16 06:46:30 -06:00
parent 5ebd696c23
commit 19b83baf88
6 changed files with 49 additions and 31 deletions

View file

@ -19,23 +19,34 @@
outputs = { self, nixpkgs, home-manager, nixvim, nix-gaming, ... }@inputs: outputs = { self, nixpkgs, home-manager, nixvim, nix-gaming, ... }@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
customPkgsOverlay = final: prev: import ./pkgs {
pkgs = prev;
lib = prev.lib;
};
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
overlays = [ customPkgsOverlay ];
}; };
lib = nixpkgs.lib; lib = nixpkgs.lib;
in { in {
nixosConfigurations = { nixosConfigurations = {
nixos = lib.nixosSystem { nixos = lib.nixosSystem {
inherit system; inherit system;
specialArgs = { specialArgs = { inherit inputs; };
inherit inputs;
inherit system;
};
modules = [ modules = [
{ nixpkgs.overlays = [ customPkgsOverlay ]; }
./hosts/configuration.nix ./hosts/configuration.nix
]; ];
}; };
}; };
homeConfigurations = {
"cobray" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs; };
modules = [ ./home-manager/cobray.nix ];
};
};
}; };
} }

View file

@ -2,6 +2,7 @@
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
fish-rust
starship starship
fzf fzf
bat bat
@ -10,7 +11,4 @@
ripgrep ripgrep
]; ];
programs.fish = {
enable = true;
};
} }

View file

@ -7,7 +7,6 @@
./boot.nix ./boot.nix
./docker.nix ./docker.nix
./env.nix ./env.nix
./fish.nix
./fonts.nix ./fonts.nix
./home-manager.nix ./home-manager.nix
./i3-xfce.nix ./i3-xfce.nix

View file

@ -1,18 +0,0 @@
{ config, pkgs, lib, ... }:
let
fish-rust = pkgs.callPackage ../pkgs/fish-rust { };
in
{
programs.fish = {
enable = true;
package = fish-rust;
};
environment.systemPackages = with pkgs; [
starship
fzf
bat
eza
fd
ripgrep
];
}

View file

@ -1,12 +1,16 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let
fish-rust = pkgs.callPackage ../pkgs/fish-rust { };
in
{ {
# Define a user account. Don't forget to set a password with 'passwd'. # Define a user account. Don't forget to set a password with 'passwd'.
users.users.cobray = { users.users.cobray = {
isNormalUser = true; isNormalUser = true;
description = "Mon Aie"; description = "Mon Aie";
extraGroups = [ "networkmanager" "wheel" "docker" "video" ]; extraGroups = [ "networkmanager" "wheel" "docker" "video" ];
shell = pkgs.fish; shell = fish-rust;
packages = with pkgs; [ packages = with pkgs; [
# User-specific packages can be defined here # User-specific packages can be defined here
# or through home-manager # or through home-manager
@ -17,4 +21,9 @@
enable = true; enable = true;
wheelNeedsPassword = true; wheelNeedsPassword = true;
}; };
programs.fish = {
enable = true;
package = fish-rust;
};
} }

View file

@ -1,13 +1,16 @@
{ lib, rustPlatform, fetchgit, ncurses, sphinx, python3 }: { lib, rustPlatform, fetchgit, ncurses, python3Packages, gettext }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "fish"; pname = "fish";
version = "4.1-2025-03-14-rust"; version = "4.1-2025-03-14-rust";
src = fetchgit { src = fetchgit {
url = "https://github.com/fish-shell/fish-shell.git"; url = "https://github.com/fish-shell/fish-shell.git";
rev = "refs/heads/master"; rev = "refs/heads/master";
fetchSubmodules = true; fetchSubmodules = true;
sha256 = "18zpwa3yddic6wdwj7g51w6n4apwsixfvl179yddk2nwfpxhv4hq"; sha256 = "18zpwa3yddic6wdwj7g51w6n4apwsixfvl179yddk2nwfpxhv4hq";
}; };
cargoLock = { cargoLock = {
lockFile = "${src}/Cargo.lock"; lockFile = "${src}/Cargo.lock";
outputHashes = { outputHashes = {
@ -15,26 +18,41 @@ rustPlatform.buildRustPackage rec {
"pcre2-sys-0.2.9" = "0mhjw7fvrzxb3fd0c534a17qgy6svz0z8269d2fs6q8aw11610mr"; "pcre2-sys-0.2.9" = "0mhjw7fvrzxb3fd0c534a17qgy6svz0z8269d2fs6q8aw11610mr";
}; };
}; };
buildInputs = [ ncurses ];
nativeBuildInputs = [ sphinx python3 ]; buildInputs = [ ncurses gettext ];
nativeBuildInputs = with python3Packages; [
sphinx
sphinx_rtd_theme
gettext
];
preBuild = '' preBuild = ''
export FISH_BUILD_VERSION="${version}" export FISH_BUILD_VERSION="${version}"
export FISH_BUILD_DOCS=1 export FISH_BUILD_DOCS=1
''; '';
postInstall = '' postInstall = ''
export HOME=$(mktemp -d) export HOME=$(mktemp -d)
mkdir -p $HOME/.local/share/fish/install mkdir -p $HOME/.local/share/fish/install
if [ ! -f $HOME/.config/fish/config.fish ]; then
$out/bin/fish --install $out/bin/fish --install
fi
mkdir -p $out/share/fish mkdir -p $out/share/fish
cp -r $HOME/.local/share/fish/install/* $out/share/fish/ 2>/dev/null || true cp -r $HOME/.local/share/fish/install/* $out/share/fish/ 2>/dev/null || true
mkdir -p $out/share/fish/tools mkdir -p $out/share/fish/tools
cp $src/share/tools/create_manpage_completions.py $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/ 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/create_manpage_completions.py
chmod +x $out/share/fish/tools/deroff.py chmod +x $out/share/fish/tools/deroff.py
rm -rf $HOME rm -rf $HOME
''; '';
doCheck = false; doCheck = false;
meta = with lib; { meta = with lib; {
description = "The user-friendly command line shell (Rust version)"; description = "The user-friendly command line shell (Rust version)";
homepage = "https://fishshell.com/"; homepage = "https://fishshell.com/";
@ -42,5 +60,6 @@ rustPlatform.buildRustPackage rec {
platforms = platforms.unix; platforms = platforms.unix;
mainProgram = "fish"; mainProgram = "fish";
}; };
passthru.shellPath = "/bin/fish"; passthru.shellPath = "/bin/fish";
} }