refactor
This commit is contained in:
parent
66c05f9093
commit
45d6f4b0f3
205 changed files with 9040 additions and 342 deletions
53
modules/home/cli-apps/fish/default.nix
Normal file
53
modules/home/cli-apps/fish/default.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
|
||||
cfg = config.plusultra.cli-apps.fish;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.fish = {
|
||||
enable = mkEnableOption "FISH shell";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
function msh --wraps mosh --description 'mosh with tmux'
|
||||
if not set -q argv[1]
|
||||
echo 'Usage: msh [user@]host [command]'
|
||||
else
|
||||
${pkgs.mosh}/bin/mosh $argv -- tmux new-session -A -s 0
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
||||
plugins = [{
|
||||
name = "foreign-env";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "oh-my-fish";
|
||||
repo = "plugin-foreign-env";
|
||||
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
|
||||
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
|
||||
};
|
||||
}];
|
||||
|
||||
shellInit =
|
||||
''
|
||||
# nix
|
||||
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
end
|
||||
|
||||
# home-manager
|
||||
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue