38 lines
1.1 KiB
Nix
38 lines
1.1 KiB
Nix
{ ... }: {
|
|
flake.homeManagerModules.wisdomShellFish =
|
|
{ config, lib, pkgs, ... }:
|
|
let
|
|
root = config.chiasson.home;
|
|
cfg = config.chiasson.home.shell.fish;
|
|
in
|
|
{
|
|
options.chiasson.home.shell.fish.enable = lib.mkEnableOption "Fish + grc, quiet greeting, rbw SSH socket defaults.";
|
|
|
|
config = lib.mkIf (root.enable && cfg.enable) {
|
|
# `fishPlugins.grc` only installs the plugin; the wrapper invokes the `grc` binary.
|
|
home.packages = [ pkgs.grc ];
|
|
|
|
programs.fish = {
|
|
enable = true;
|
|
interactiveShellInit = ''
|
|
set fish_greeting ""
|
|
if test -z "$SSH_AUTH_SOCK"
|
|
if test -n "$XDG_RUNTIME_DIR"
|
|
set -gx SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/rbw/ssh-agent-socket"
|
|
else
|
|
set -l _hm_uid (${pkgs.coreutils}/bin/id -u)
|
|
set -gx SSH_AUTH_SOCK "/run/user/$_hm_uid/rbw/ssh-agent-socket"
|
|
end
|
|
end
|
|
'';
|
|
plugins = [
|
|
{
|
|
name = "grc";
|
|
src = pkgs.fishPlugins.grc.src;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|