mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
nix: expose shared home manager configuration via homeModules
This commit is contained in:
parent
5155bd69e8
commit
5b95c43559
47 changed files with 45 additions and 29 deletions
106
nix/homeModules/fish/default.nix
Normal file
106
nix/homeModules/fish/default.nix
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ./aliasesAbbrs.nix ];
|
||||
|
||||
programs.fish =
|
||||
let
|
||||
readConfig = n: builtins.readFile ./conf.d/${n}.fish;
|
||||
readConfigs = ns: builtins.concatStringsSep "\n" (map readConfig ns);
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
|
||||
shellInit = ''
|
||||
${readConfig "shellInit"}
|
||||
|
||||
# Just in case $PATH is broken, add them in an idempotent fashion
|
||||
fish_add_path --prepend --move /nix/var/nix/profiles/default/bin
|
||||
fish_add_path --prepend --move ${config.home.homeDirectory}/.local/.local/bin
|
||||
fish_add_path --prepend --move ${config.home.homeDirectory}/.dotfiles/.local/bin
|
||||
fish_add_path --prepend --move ${config.home.homeDirectory}/.nix-profile/bin
|
||||
fish_add_path --prepend --move /run/current-system/sw/bin
|
||||
fish_add_path --prepend --move /etc/profiles/per-user/${config.home.username}/bin # prioritize user path
|
||||
|
||||
# Make sure wrapper comes first
|
||||
# https://discourse.nixos.org/t/sudo-run-current-system-sw-bin-sudo-must-be-owned-by-uid-0-and-have-the-setuid-bit-set-and-cannot-chdir-var-cron-bailing-out-var-cron-permission-denied/20463/2
|
||||
fish_add_path --prepend --move /run/wrappers/bin
|
||||
|
||||
${lib.strings.optionalString pkgs.stdenv.isDarwin ''
|
||||
# Add brew, but as fallback
|
||||
# Don't move it at all
|
||||
fish_add_path --path --append /opt/homebrew/bin; :
|
||||
''}
|
||||
'';
|
||||
|
||||
interactiveShellInit = readConfigs [
|
||||
"interactiveShellInit"
|
||||
"bind"
|
||||
"colorscheme"
|
||||
"locale"
|
||||
];
|
||||
|
||||
functions =
|
||||
let
|
||||
makeFishFunctions =
|
||||
ns:
|
||||
lib.trivial.pipe ns [
|
||||
(map (n: {
|
||||
name = n;
|
||||
value = builtins.readFile ./functions/${n}.fish;
|
||||
}))
|
||||
builtins.listToAttrs
|
||||
];
|
||||
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 = [
|
||||
{
|
||||
name = "fzf-fish";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "PatrickF1";
|
||||
repo = "fzf.fish";
|
||||
rev = "v10.3";
|
||||
hash = "sha256-T8KYLA/r/gOKvAivKRoeqIwE2pINlxFQtZJHpOy9GMM=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "colored-man-pages";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "PatrickF1";
|
||||
repo = "colored_man_pages.fish";
|
||||
rev = "f885c2507128b70d6c41b043070a8f399988bc7a";
|
||||
sha256 = "sha256-ii9gdBPlC1/P1N9xJzqomrkyDqIdTg+iCg0mwNVq2EU=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "sponge";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "meaningful-ooo";
|
||||
repo = "sponge";
|
||||
sha256 = "sha256-MdcZUDRtNJdiyo2l9o5ma7nAX84xEJbGFhAVhK+Zm1w=";
|
||||
rev = "1.1.0";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue