Add fish wrapper and make it my default shell

This commit is contained in:
Nikodem Rabuliński 2024-01-09 15:33:18 +01:00
parent b81483f2a1
commit cd884602d9
4 changed files with 50 additions and 3 deletions

View file

@ -3,8 +3,11 @@
configurationName,
lib,
pkgs,
inputs',
username,
...
}: let
inherit (inputs'.settei.packages) fish;
sharedConfig = {
settei.user.config = {
programs.git = {
@ -22,7 +25,17 @@
push.followTags = true;
};
};
programs.fish.enable = true;
};
programs.fish.enable = true;
environment.shells = [fish];
users.users.${username}.shell = fish;
# NixOS' fish module doesn't allow setting what package to use for fish,
# so I need to override the fish package.
nixpkgs.overlays = [(_: _: {inherit fish;})];
};
linuxConfig = lib.optionalAttrs isLinux {

View file

@ -18,20 +18,30 @@
./starship
./helix
./rash
./fish
];
};
all-packages = wrapped.config.build.packages;
fish-base = pkgs.fish;
fish-wrapped = all-packages.fish;
fish = pkgs.symlinkJoin {
inherit (fish-base) name meta passthru;
paths = [ fish-wrapped fish-base ];
};
base-packages = pkgs.symlinkJoin {
name = "settei-base";
paths = with all-packages; [
helix
paths = [
all-packages.helix
fish
];
};
in {
packages =
all-packages
// {
inherit base-packages;
inherit base-packages fish;
};
};
}

View file

@ -0,0 +1,9 @@
# Abbreviations
abbr --add --global -- flake-update 'nix flake lock --update-input'
abbr --add --global -- ns 'nix shell'
abbr --add --global -- nss 'nix search'
abbr --add --global -- vim hx
# Aliases
alias cat bat
alias l 'eza -lah --group-directories-first --icons'

15
wrappers/fish/default.nix Normal file
View file

@ -0,0 +1,15 @@
{lib, pkgs, ...}: {
# TODO: Fix once https://github.com/viperML/wrapper-manager/issues/14 is resolved
wrappers.fish = {
basePackage = pkgs.runCommandNoCC "fish-binary" {} ''
install -D -m555 ${lib.getExe pkgs.fish} "$out/bin/fish"
'';
prependFlags = [
"-C"
"source ${./config.fish}"
];
pathAdd = with pkgs; [bat eza];
};
}