53 lines
1.3 KiB
Nix
53 lines
1.3 KiB
Nix
{ config, lib, pkgs, inputs, ... }:
|
|
|
|
with lib;
|
|
let
|
|
cfg = config.modules.software.system.fish;
|
|
nix-colors-lib = inputs.nix-colors.lib.contrib { inherit pkgs; };
|
|
in {
|
|
options.modules.software.system.fish = {
|
|
enable = mkEnableOption "Enable fish, the friendly interpreted shell";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
# runtime dependencies of plugins
|
|
user.packages = with pkgs; [
|
|
# fzf-fish
|
|
bat fd fzf
|
|
# grc
|
|
grc
|
|
# tide
|
|
fishPlugins.tide
|
|
# done
|
|
libnotify
|
|
];
|
|
|
|
programs.fish.enable = true;
|
|
users.defaultUserShell = pkgs.fish;
|
|
hm.programs.fish = let
|
|
colorScript = nix-colors-lib.shellThemeFromScheme { scheme = config.colorScheme; };
|
|
in {
|
|
enable = true;
|
|
plugins = let
|
|
mkPlugin = name: {
|
|
inherit name;
|
|
inherit (pkgs.fishPlugins.${name}) src;
|
|
};
|
|
in builtins.map (p: mkPlugin p) [
|
|
"autopair"
|
|
"done"
|
|
"forgit"
|
|
"fzf-fish"
|
|
"grc"
|
|
"tide"
|
|
];
|
|
interactiveShellInit = ''
|
|
${lib.getExe pkgs.nix-your-shell} fish | source
|
|
sh ${colorScript}
|
|
'';
|
|
functions.fish_greeting = ''
|
|
${lib.getExe pkgs.fastfetch} --logo-type small --key-width 11 -s title:separator:os:host:kernel:uptime:memory:swap
|
|
'';
|
|
};
|
|
};
|
|
}
|