Rebase to flake parts #9
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
{ ... }: {
|
||||
flake.homeManagerModules.wisdomShellBash =
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
root = config.chiasson.home;
|
||||
cfg = config.chiasson.home.shell.bash;
|
||||
in
|
||||
{
|
||||
options.chiasson.home.shell.bash.enable = lib.mkEnableOption "Bash + rbw SSH socket env in profile/init." // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable) {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
profileExtra = ''
|
||||
if [ -z "''${SSH_AUTH_SOCK:-}" ]; then
|
||||
if [ -n "''${XDG_RUNTIME_DIR:-}" ]; then
|
||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/rbw/ssh-agent-socket"
|
||||
else
|
||||
export SSH_AUTH_SOCK="/run/user/$(id -u)/rbw/ssh-agent-socket"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
initExtra = ''
|
||||
if [ -z "''${SSH_AUTH_SOCK:-}" ]; then
|
||||
if [ -n "''${XDG_RUNTIME_DIR:-}" ]; then
|
||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/rbw/ssh-agent-socket"
|
||||
else
|
||||
export SSH_AUTH_SOCK="/run/user/$(id -u)/rbw/ssh-agent-socket"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{ ... }: {
|
||||
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;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{ ... }: {
|
||||
flake.homeManagerModules.wisdomShellOhMyPosh =
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
root = config.chiasson.home;
|
||||
cfg = config.chiasson.home.shell.ohMyPosh;
|
||||
in
|
||||
{
|
||||
options.chiasson.home.shell.ohMyPosh = {
|
||||
enable = lib.mkEnableOption "[Oh My Posh](https://ohmyposh.dev/) prompt.";
|
||||
|
||||
builtinTheme = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "jandedobbeleer";
|
||||
description = ''
|
||||
Stock theme when DMS is not overriding `configFile` (DMS replaces this with matugen output).
|
||||
'';
|
||||
};
|
||||
|
||||
enableFishIntegration = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Run `oh-my-posh init fish` in Fish `shellInit` (Home Manager).";
|
||||
};
|
||||
|
||||
enableBashIntegration = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Run `oh-my-posh init bash` in bash `initExtra`.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable) {
|
||||
programs.oh-my-posh = {
|
||||
enable = true;
|
||||
inherit (cfg) enableFishIntegration enableBashIntegration;
|
||||
useTheme = lib.mkDefault cfg.builtinTheme;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
{ ... }: {
|
||||
# Optional fragment: import from `home.users.<name>.extraModules` only on hosts that need Yazi so this
|
||||
# module (and its `pkgs.yazi` wiring) is not evaluated when omitted.
|
||||
flake.homeManagerModules.wisdomShellYazi =
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
root = config.chiasson.home;
|
||||
cfg = config.chiasson.home.shell.yazi;
|
||||
in
|
||||
{
|
||||
options.chiasson.home.shell.yazi.enable = lib.mkEnableOption "Yazi as `y` + 7zz with rar.";
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable) {
|
||||
programs.yazi = {
|
||||
enable = true;
|
||||
package = pkgs.yazi.override {
|
||||
_7zz = pkgs._7zz-rar;
|
||||
};
|
||||
shellWrapperName = "y";
|
||||
settings = {
|
||||
manager = {
|
||||
ratio = [
|
||||
1
|
||||
4
|
||||
3
|
||||
];
|
||||
sort_by = "natural";
|
||||
sort_sensitive = true;
|
||||
sort_reverse = false;
|
||||
sort_dir_first = true;
|
||||
linemode = "none";
|
||||
show_hidden = true;
|
||||
show_symlink = true;
|
||||
};
|
||||
preview = {
|
||||
image_filter = "lanczos3";
|
||||
image_quality = 90;
|
||||
tab_size = 1;
|
||||
max_width = 600;
|
||||
max_height = 900;
|
||||
cache_dir = "";
|
||||
ueberzug_scale = 1;
|
||||
ueberzug_offset = [
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
];
|
||||
};
|
||||
tasks = {
|
||||
micro_workers = 5;
|
||||
macro_workers = 10;
|
||||
bizarre_retry = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user