mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-07 07:09:15 +00:00
ref(nix): cleaned up fish nix config
This commit is contained in:
parent
d450699d16
commit
c21c8e2807
8 changed files with 149 additions and 169 deletions
|
|
@ -1,72 +1,67 @@
|
|||
{pkgs, ...}: {
|
||||
programs = let
|
||||
programs.fish = let
|
||||
inherit (builtins) readFile foldl' map listToAttrs concatMap;
|
||||
inherit (pkgs) callPackage;
|
||||
readConfig = n: readFile ./conf.d/${n}.fish;
|
||||
readConfigs = ns:
|
||||
foldl' (l: r: l + "\n" + r) ""
|
||||
(map readConfig ns);
|
||||
in {
|
||||
fish = {
|
||||
enable = true;
|
||||
shellInit = readFile ./shellInit.fish;
|
||||
interactiveShellInit = let
|
||||
readConfigs = ns:
|
||||
foldl' (l: r: l + "\n" + r) ""
|
||||
(
|
||||
map
|
||||
(n: readFile ./conf.d/${n}.fish)
|
||||
ns
|
||||
);
|
||||
in
|
||||
readFile ./interactiveShellInit.fish
|
||||
+ readConfigs [
|
||||
"alias"
|
||||
"bind"
|
||||
"colorscheme"
|
||||
"locale"
|
||||
];
|
||||
enable = true;
|
||||
|
||||
functions = let
|
||||
makeFishFunctions = ns:
|
||||
listToAttrs
|
||||
(
|
||||
concatMap
|
||||
(n: [
|
||||
{
|
||||
name = n;
|
||||
value = readFile ./functions/${n}.fish;
|
||||
}
|
||||
])
|
||||
ns
|
||||
);
|
||||
in
|
||||
makeFishFunctions [
|
||||
"clone_to_repos"
|
||||
"file_extension"
|
||||
"file_mantissa"
|
||||
"fish_command_not_found"
|
||||
"fish_greeting"
|
||||
"fish_remove_path"
|
||||
"largest-objects-in-repo"
|
||||
"snakecase"
|
||||
"timestamp"
|
||||
"tmux_attach"
|
||||
"tmux_home"
|
||||
"tmux_last"
|
||||
"tmux_sessionizer"
|
||||
"update_dotfiles"
|
||||
];
|
||||
plugins = let
|
||||
makeFishPlugins = ns: (concatMap
|
||||
shellInit = readConfig "shellInit";
|
||||
|
||||
interactiveShellInit =
|
||||
readConfigs ["interactiveShellInit" "bind" "colorscheme" "locale"];
|
||||
|
||||
shellAliases = (callPackage ./aliasesAbbrs.nix {}).shellAliases;
|
||||
shellAbbrs = (callPackage ./aliasesAbbrs.nix {}).shellAbbrs;
|
||||
|
||||
functions = let
|
||||
makeFishFunctions = ns:
|
||||
listToAttrs
|
||||
(
|
||||
concatMap
|
||||
(n: [
|
||||
{
|
||||
name = n;
|
||||
src = pkgs.fishPlugins.${n};
|
||||
value = readFile ./functions/${n}.fish;
|
||||
}
|
||||
])
|
||||
ns);
|
||||
in
|
||||
makeFishPlugins [
|
||||
"fzf-fish"
|
||||
"colored-man-pages"
|
||||
"sponge"
|
||||
];
|
||||
};
|
||||
ns
|
||||
);
|
||||
in
|
||||
makeFishFunctions [
|
||||
"clone_to_repos"
|
||||
"file_extension"
|
||||
"file_mantissa"
|
||||
"fish_command_not_found"
|
||||
"fish_greeting"
|
||||
"fish_remove_path"
|
||||
"largest-objects-in-repo"
|
||||
"snakecase"
|
||||
"timestamp"
|
||||
"tmux_attach"
|
||||
"tmux_home"
|
||||
"tmux_last"
|
||||
"tmux_sessionizer"
|
||||
"update_dotfiles"
|
||||
];
|
||||
|
||||
plugins = let
|
||||
makeFishPlugins = ns: (concatMap
|
||||
(n: [
|
||||
{
|
||||
name = n;
|
||||
src = pkgs.fishPlugins.${n};
|
||||
}
|
||||
])
|
||||
ns);
|
||||
in
|
||||
makeFishPlugins [
|
||||
"fzf-fish"
|
||||
"colored-man-pages"
|
||||
"sponge"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue