treewide: config/home-manager -> modules/hm
Moved every remaining home-manager piece of configuration to its own hm module.
This commit is contained in:
parent
d7356d3fde
commit
09a07b15da
38 changed files with 374 additions and 448 deletions
|
@ -1,3 +0,0 @@
|
|||
_: {
|
||||
imports = [./terminal];
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
_: {
|
||||
imports = [
|
||||
./programs
|
||||
./shell
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
osConfig,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
in {
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
font = "monospace:size=14";
|
||||
shell = "${lib.getExe config.programs.fish.package}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
_: {
|
||||
programs.gnome-terminal = {
|
||||
enable = true;
|
||||
showMenubar = true;
|
||||
profile = {
|
||||
"4621184a-b921-42cf-80a0-7784516606f2" = {
|
||||
default = true;
|
||||
audibleBell = false;
|
||||
allowBold = true;
|
||||
boldIsBright = true;
|
||||
visibleName = "default";
|
||||
font = "Intel One Mono 14";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
{
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
# package = inputs.wezterm.packages.${pkgs.system}.default;
|
||||
extraConfig = ''
|
||||
local w = require('wezterm')
|
||||
|
||||
local function is_vim(pane)
|
||||
return pane:get_user_vars().IS_NVIM == 'true'
|
||||
end
|
||||
|
||||
local direction_keys = {
|
||||
h = 'Left',
|
||||
j = 'Down',
|
||||
k = 'Up',
|
||||
l = 'Right',
|
||||
}
|
||||
|
||||
local function split_nav(resize_or_move, key)
|
||||
return {
|
||||
key = key,
|
||||
mods = resize_or_move == 'resize' and 'META' or 'CTRL',
|
||||
action = w.action_callback(function(win, pane)
|
||||
if is_vim(pane) then
|
||||
win:perform_action({
|
||||
SendKey = { key = key, mods = resize_or_move == 'resize' and 'META' or 'CTRL' },
|
||||
}, pane)
|
||||
else
|
||||
if resize_or_move == 'resize' then
|
||||
win:perform_action({ AdjustPaneSize = { direction_keys[key], 3 } }, pane)
|
||||
else
|
||||
win:perform_action({ ActivatePaneDirection = direction_keys[key] }, pane)
|
||||
end
|
||||
end
|
||||
end),
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
enable_wayland = false,
|
||||
front_end = "WebGpu",
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
show_new_tab_button_in_tab_bar = false,
|
||||
harfbuzz_features = { "ss01", "ss03" },
|
||||
|
||||
leader = { key = " ", mods = "CTRL", timeout_milliseconds = 1000 },
|
||||
|
||||
keys = {
|
||||
{
|
||||
mods = "LEADER",
|
||||
key = "-",
|
||||
action = wezterm.action.SplitVertical { domain = "CurrentPaneDomain" }
|
||||
},
|
||||
{
|
||||
mods = "LEADER",
|
||||
key = "=",
|
||||
action = wezterm.action.SplitHorizontal { domain = "CurrentPaneDomain" }
|
||||
},
|
||||
split_nav('move', 'h'),
|
||||
split_nav('move', 'j'),
|
||||
split_nav('move', 'k'),
|
||||
split_nav('move', 'l'),
|
||||
split_nav('resize', 'h'),
|
||||
split_nav('resize', 'j'),
|
||||
split_nav('resize', 'k'),
|
||||
split_nav('resize', 'l'),
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
config.theme = "base16";
|
||||
};
|
||||
|
||||
home = {
|
||||
sessionVariables = {
|
||||
MANPAGER = "sh -c 'col -bx | bat --language man' ";
|
||||
MANROFFOPT = "-c";
|
||||
};
|
||||
|
||||
packages = with pkgs.bat-extras; [
|
||||
batman
|
||||
];
|
||||
|
||||
shellAliases.man = "batman";
|
||||
};
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./bat.nix
|
||||
./git.nix
|
||||
./gnupg.nix
|
||||
./tmux.nix
|
||||
./direnv.nix
|
||||
./nix-index.nix
|
||||
./yazi.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# archives
|
||||
zip
|
||||
unzip
|
||||
unrar
|
||||
|
||||
# utils
|
||||
fd
|
||||
file
|
||||
ripgrep
|
||||
];
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
programs = {
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Anthony Rodriguez";
|
||||
userEmail = "anthony@nezia.dev";
|
||||
signing = {
|
||||
signByDefault = true;
|
||||
key = "EE3BE97C040A86CE";
|
||||
};
|
||||
extraConfig = {
|
||||
push.autoSetupRemote = true;
|
||||
init = {
|
||||
defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.lazygit = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
home.shellAliases = {
|
||||
lg = "lazygit";
|
||||
g = "git";
|
||||
gs = "git status";
|
||||
gsh = "git show HEAD";
|
||||
gshs = "DELTA_FEATURES=+side-by-side git show HEAD";
|
||||
ga = "git add";
|
||||
gaa = "git add :/";
|
||||
gap = "git add -p";
|
||||
gc = "git commit";
|
||||
gca = "git commit --amend";
|
||||
gcm = "git commit --message";
|
||||
gcf = "git commit --fixup";
|
||||
gk = "git checkout";
|
||||
gkp = "git checkout -p";
|
||||
gd = "git diff";
|
||||
gds = "DELTA_FEATURES=+side-by-side git diff";
|
||||
gdc = "git diff --cached";
|
||||
gdcs = "DELTA_FEATURES=+side-by-side git diff --cached";
|
||||
gf = "git fetch";
|
||||
gl = "git log";
|
||||
glp = "git log -p";
|
||||
glps = "DELTA_FEATURES=+side-by-side git log -p";
|
||||
gp = "git push";
|
||||
gpf = "git push --force-with-lease";
|
||||
gr = "git reset";
|
||||
gra = "git reset :/";
|
||||
grp = "git reset -p";
|
||||
gt = "git stash";
|
||||
gtp = "git stash pop";
|
||||
gu = "git pull";
|
||||
};
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
programs.gpg.enable = true;
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{inputs, ...}: {
|
||||
imports = [inputs.nix-index-db.hmModules.nix-index];
|
||||
programs = {
|
||||
nix-index = {
|
||||
enable = true;
|
||||
symlinkToCacheHome = true; # needed for comma
|
||||
};
|
||||
command-not-found.enable = false;
|
||||
nix-index-database.comma.enable = true;
|
||||
};
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
prefix = "C-space";
|
||||
escapeTime = 10;
|
||||
clock24 = true;
|
||||
keyMode = "vi";
|
||||
mouse = true;
|
||||
baseIndex = 1;
|
||||
extraConfig = ''
|
||||
set-option -a terminal-features "''${TERM}:RGB"
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
bind '"' split-window -v -c "#{pane_current_path}"
|
||||
bind '%' split-window -h -c "#{pane_current_path}"
|
||||
bind C-k clear-history
|
||||
'';
|
||||
plugins = with pkgs; [
|
||||
tmuxPlugins.vim-tmux-navigator
|
||||
tmuxPlugins.yank
|
||||
];
|
||||
};
|
||||
programs.fzf.tmux.enableShellIntegration = true;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
programs.yazi = let
|
||||
# https://github.com/iynaix/dotfiles/blob/8bb1568019ea26f034ac1af9c499b3ff102391a5/home-manager/shell/yazi.nix#L9-L11
|
||||
mkYaziPlugin = name: text: {
|
||||
"${name}" = toString (pkgs.writeTextDir "${name}.yazi/init.lua" text) + "/${name}.yazi";
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
plugins = mkYaziPlugin "smart-enter" ''
|
||||
return {
|
||||
entry = function()
|
||||
local h = cx.active.current.hovered
|
||||
ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true })
|
||||
end,
|
||||
}
|
||||
'';
|
||||
keymap.manager.prepend_keymap = [
|
||||
{
|
||||
on = "l";
|
||||
run = "plugin --sync smart-enter";
|
||||
desc = "Enter the child directory, or open the file";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
starshipTransient = lib.strings.optionalString config.programs.starship.enableTransience ''
|
||||
function starship_transient_prompt_func
|
||||
starship module character
|
||||
end
|
||||
|
||||
function starship_transient_rprompt_func
|
||||
starship module cmd_duration
|
||||
end
|
||||
'';
|
||||
in {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit =
|
||||
starshipTransient
|
||||
+ ''
|
||||
set fish_greeting # Disable greeting
|
||||
fish_vi_key_bindings # Enable Vi mode
|
||||
|
||||
'';
|
||||
plugins = [
|
||||
{
|
||||
name = "fzf";
|
||||
inherit (pkgs.fishPlugins.fzf) src;
|
||||
}
|
||||
{
|
||||
name = "autopair";
|
||||
inherit (pkgs.fishPlugins.autopair) src;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
||||
then
|
||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
{
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
let carapace_completer = {|spans|
|
||||
carapace $spans.0 nushell ...$spans | from json
|
||||
}
|
||||
$env.config = {
|
||||
show_banner: false,
|
||||
completions: {
|
||||
case_sensitive: false # case-sensitive completions
|
||||
quick: true # set to false to prevent auto-selecting completions
|
||||
partial: true # set to false to prevent partial filling of the prompt
|
||||
algorithm: "fuzzy" # prefix or fuzzy
|
||||
external: {
|
||||
# set to false to prevent nushell looking into $env.PATH to find more suggestions
|
||||
enable: true
|
||||
# set to lower can improve completion performance at the cost of omitting some options
|
||||
max_results: 100
|
||||
completer: $carapace_completer # check 'carapace_completer'
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
programs.carapace = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableTransience = true;
|
||||
settings = {
|
||||
add_newline = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableBashIntegration = false;
|
||||
};
|
||||
}
|
30
flake.lock
30
flake.lock
|
@ -148,11 +148,11 @@
|
|||
},
|
||||
"locked": {
|
||||
"dir": "pkgs/firefox-addons",
|
||||
"lastModified": 1736827411,
|
||||
"narHash": "sha256-/1R1OQENTSaTl1vJcxsT/bdFjpht2540WglelNgZF4g=",
|
||||
"lastModified": 1736913802,
|
||||
"narHash": "sha256-72be03HWS5Q8I1W9hlWRVicZxL5MJURVKbnJGIcbjIE=",
|
||||
"owner": "rycee",
|
||||
"repo": "nur-expressions",
|
||||
"rev": "f769498f3ed5cc64f54815b119b283b1c4ebf580",
|
||||
"rev": "79a77a7d0b22e82d52a90055cc8206447ab85285",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1080,11 +1080,11 @@
|
|||
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1736872218,
|
||||
"narHash": "sha256-scTjWVpKPqznhwdqLZuDxZUibwpy7DjhOag9a2YcDMs=",
|
||||
"lastModified": 1736884105,
|
||||
"narHash": "sha256-WHxMcVuEmJvToC5DEVnSLwUrpHgJyqUqd/O8gZuaQsU=",
|
||||
"owner": "sodiboo",
|
||||
"repo": "niri-flake",
|
||||
"rev": "3749a14701875ca7c17047034dfe9b0a134268fe",
|
||||
"rev": "a4e712bccfbe0526327c10b67f765b49cbbd7701",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1113,11 +1113,11 @@
|
|||
"niri-unstable": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1736851192,
|
||||
"narHash": "sha256-579fAoE9hZtuZHlYLMH0mICaak1HPEmymiKdF/HJAig=",
|
||||
"lastModified": 1736879117,
|
||||
"narHash": "sha256-elG0TiWNFwgfTLrTTZVZQp3dEN6F6Qds6UF6BVxCIHs=",
|
||||
"owner": "YaLTeR",
|
||||
"repo": "niri",
|
||||
"rev": "0df7a085de6fb0ebfe7af640e60fb496e52656aa",
|
||||
"rev": "a3cbe3514ba195bf74815008f75819944f888527",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1573,11 +1573,11 @@
|
|||
"systems": "systems_7"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1736859751,
|
||||
"narHash": "sha256-gyfPxf8vyEpLSSSnl5zlbVRsTzt4UWOol5V8FijZhl8=",
|
||||
"lastModified": 1736946667,
|
||||
"narHash": "sha256-7z13M0L4DK9srgXnTXFFnfQsYioL2BrkfQieRI7A7wo=",
|
||||
"owner": "notashelf",
|
||||
"repo": "nvf",
|
||||
"rev": "9142a5b9dd7dacf54825d2fcd730604457535ebc",
|
||||
"rev": "45a6d9b890e97fe8183874aafb1f17b1335f8bdf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -3912,11 +3912,11 @@
|
|||
"systems": "systems_8"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1736881943,
|
||||
"narHash": "sha256-1oX68vOJtUqeuDt7vio1miloSo8AgSWN8/IebJeJU5I=",
|
||||
"lastModified": 1736883896,
|
||||
"narHash": "sha256-Lx6MHiRD69xSpneaFTr6wjp9jX28ZkVt+glxTLonJc4=",
|
||||
"owner": "abenz1267",
|
||||
"repo": "walker",
|
||||
"rev": "5ba2c3c9134c2b15a4ecbdfcabddb2c62bfadd9f",
|
||||
"rev": "f8690c097551de73f098ff1ab56ac2f62f821f88",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -1,62 +1,23 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
{inputs, ...}: let
|
||||
lib' = import ../shared/lib inputs.nixpkgs.lib;
|
||||
mkSystem = args:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs lib';};
|
||||
modules = (args.modules or []) ++ [../modules];
|
||||
};
|
||||
|
||||
base = [
|
||||
({
|
||||
config,
|
||||
specialArgs,
|
||||
...
|
||||
}: {
|
||||
home-manager = {
|
||||
users.${config.local.systemVars.username}.imports = [
|
||||
../modules/hm
|
||||
"${self}/config/home-manager"
|
||||
];
|
||||
|
||||
extraSpecialArgs = specialArgs;
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
graphical = [
|
||||
({config, ...}: {
|
||||
home-manager.users.${config.local.systemVars.username}.imports = [
|
||||
"${self}/config/home-manager/terminal/emulators/foot.nix"
|
||||
];
|
||||
})
|
||||
];
|
||||
in {
|
||||
vamos = mkSystem {
|
||||
modules =
|
||||
[
|
||||
./vamos
|
||||
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
||||
]
|
||||
++ base
|
||||
++ graphical;
|
||||
modules = [
|
||||
./vamos
|
||||
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
||||
];
|
||||
};
|
||||
|
||||
solaire = mkSystem {
|
||||
modules =
|
||||
[
|
||||
./solaire
|
||||
]
|
||||
++ base
|
||||
++ graphical;
|
||||
modules = [./solaire];
|
||||
};
|
||||
|
||||
anastacia = mkSystem {
|
||||
modules = [
|
||||
./anastacia
|
||||
];
|
||||
modules = [./anastacia];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
./editors
|
||||
./hypr
|
||||
./media
|
||||
./terminal
|
||||
|
||||
./games.nix
|
||||
./gnome.nix
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
# thanks https://github.com/fufexan/dotfiles/blob/c0b3c77d95ce1f574a87e7f7ead672ca0d951245/home/programs/wayland/hyprland/binds.nix#L16-L20
|
||||
toggle = program: uwsm: let
|
||||
prog = builtins.substring 0 14 program;
|
||||
in "pkill ${prog} || ${lib.optionalString uwsm "uwsm app --"} ${program}";
|
||||
in "pkill ${prog} || ${lib.optionalString uwsm "uwsm app -- "} ${program}";
|
||||
runOnce = program: "pgrep ${program} || uwsm app -- ${program}";
|
||||
run = program: "uwsm app -- ${program}";
|
||||
in {
|
||||
|
@ -23,7 +23,7 @@ in {
|
|||
", Print, exec, ${runOnce "grimblast"} --notify --cursor copysave output"
|
||||
"$mod, q, killactive"
|
||||
"$mod SHIFT, q, exec, loginctl terminate-user ''"
|
||||
"$mod, period, exec, walker -m emojis" # not using uwsm as it already runs as a service
|
||||
"$mod, period, exec, ${toggle "walker -m emojis" false}" # not using uwsm as it already runs as a service
|
||||
"CTRL, Print, exec, ${runOnce "grimblast"} --notify --cursor --freeze copysave area"
|
||||
|
||||
"$mod, h, movefocus, l"
|
||||
|
|
17
modules/hm/programs/terminal/default.nix
Normal file
17
modules/hm/programs/terminal/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./emulators
|
||||
./programs
|
||||
./shell
|
||||
];
|
||||
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
};
|
||||
}
|
3
modules/hm/programs/terminal/emulators/default.nix
Normal file
3
modules/hm/programs/terminal/emulators/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
imports = [./foot.nix];
|
||||
}
|
19
modules/hm/programs/terminal/emulators/foot.nix
Normal file
19
modules/hm/programs/terminal/emulators/foot.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf osConfig.local.modules.hyprland.enable {
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
font = "monospace:size=14";
|
||||
shell = "${lib.getExe config.programs.fish.package}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
26
modules/hm/programs/terminal/programs/bat.nix
Normal file
26
modules/hm/programs/terminal/programs/bat.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
config.theme = "base16";
|
||||
};
|
||||
|
||||
home = {
|
||||
sessionVariables = {
|
||||
MANPAGER = "sh -c 'col -bx | bat --language man' ";
|
||||
MANROFFOPT = "-c";
|
||||
};
|
||||
|
||||
packages = with pkgs.bat-extras; [
|
||||
batman
|
||||
];
|
||||
|
||||
shellAliases.man = "batman";
|
||||
};
|
||||
};
|
||||
}
|
12
modules/hm/programs/terminal/programs/default.nix
Normal file
12
modules/hm/programs/terminal/programs/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
imports = [
|
||||
./bat.nix
|
||||
./direnv.nix
|
||||
./git.nix
|
||||
./gnupg.nix
|
||||
./misc.nix
|
||||
./nix-index.nix
|
||||
./tmux.nix
|
||||
./yazi.nix
|
||||
];
|
||||
}
|
14
modules/hm/programs/terminal/programs/direnv.nix
Normal file
14
modules/hm/programs/terminal/programs/direnv.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
programs = {
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
60
modules/hm/programs/terminal/programs/git.nix
Normal file
60
modules/hm/programs/terminal/programs/git.nix
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Anthony Rodriguez";
|
||||
userEmail = "anthony@nezia.dev";
|
||||
signing = {
|
||||
signByDefault = true;
|
||||
key = "EE3BE97C040A86CE";
|
||||
};
|
||||
extraConfig = {
|
||||
push.autoSetupRemote = true;
|
||||
init = {
|
||||
defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.lazygit = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
home.shellAliases = {
|
||||
lg = "lazygit";
|
||||
g = "git";
|
||||
gs = "git status";
|
||||
gsh = "git show HEAD";
|
||||
gshs = "DELTA_FEATURES=+side-by-side git show HEAD";
|
||||
ga = "git add";
|
||||
gaa = "git add :/";
|
||||
gap = "git add -p";
|
||||
gc = "git commit";
|
||||
gca = "git commit --amend";
|
||||
gcm = "git commit --message";
|
||||
gcf = "git commit --fixup";
|
||||
gk = "git checkout";
|
||||
gkp = "git checkout -p";
|
||||
gd = "git diff";
|
||||
gds = "DELTA_FEATURES=+side-by-side git diff";
|
||||
gdc = "git diff --cached";
|
||||
gdcs = "DELTA_FEATURES=+side-by-side git diff --cached";
|
||||
gf = "git fetch";
|
||||
gl = "git log";
|
||||
glp = "git log -p";
|
||||
glps = "DELTA_FEATURES=+side-by-side git log -p";
|
||||
gp = "git push";
|
||||
gpf = "git push --force-with-lease";
|
||||
gr = "git reset";
|
||||
gra = "git reset :/";
|
||||
grp = "git reset -p";
|
||||
gt = "git stash";
|
||||
gtp = "git stash pop";
|
||||
gu = "git pull";
|
||||
};
|
||||
};
|
||||
}
|
14
modules/hm/programs/terminal/programs/gnupg.nix
Normal file
14
modules/hm/programs/terminal/programs/gnupg.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
programs.gpg.enable = true;
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
};
|
||||
}
|
20
modules/hm/programs/terminal/programs/misc.nix
Normal file
20
modules/hm/programs/terminal/programs/misc.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
home.packages = with pkgs; [
|
||||
# archives
|
||||
zip
|
||||
unzip
|
||||
unrar
|
||||
|
||||
# utils
|
||||
fd
|
||||
file
|
||||
ripgrep
|
||||
];
|
||||
};
|
||||
}
|
19
modules/hm/programs/terminal/programs/nix-index.nix
Normal file
19
modules/hm/programs/terminal/programs/nix-index.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
inputs,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
imports = [inputs.nix-index-db.hmModules.nix-index];
|
||||
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
programs = {
|
||||
nix-index = {
|
||||
enable = true;
|
||||
symlinkToCacheHome = true; # needed for comma
|
||||
};
|
||||
command-not-found.enable = false;
|
||||
nix-index-database.comma.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
30
modules/hm/programs/terminal/programs/tmux.nix
Normal file
30
modules/hm/programs/terminal/programs/tmux.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
prefix = "C-space";
|
||||
escapeTime = 10;
|
||||
clock24 = true;
|
||||
keyMode = "vi";
|
||||
mouse = true;
|
||||
baseIndex = 1;
|
||||
extraConfig = ''
|
||||
set-option -a terminal-features "''${TERM}:RGB"
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
bind '"' split-window -v -c "#{pane_current_path}"
|
||||
bind '%' split-window -h -c "#{pane_current_path}"
|
||||
bind C-k clear-history
|
||||
'';
|
||||
plugins = with pkgs; [
|
||||
tmuxPlugins.vim-tmux-navigator
|
||||
tmuxPlugins.yank
|
||||
];
|
||||
};
|
||||
programs.fzf.tmux.enableShellIntegration = true;
|
||||
};
|
||||
}
|
33
modules/hm/programs/terminal/programs/yazi.nix
Normal file
33
modules/hm/programs/terminal/programs/yazi.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf osConfig.local.modules.hyprland.enable {
|
||||
programs.yazi = let
|
||||
# https://github.com/iynaix/dotfiles/blob/8bb1568019ea26f034ac1af9c499b3ff102391a5/home-manager/shell/yazi.nix#L9-L11
|
||||
mkYaziPlugin = name: text: {
|
||||
"${name}" = toString (pkgs.writeTextDir "${name}.yazi/init.lua" text) + "/${name}.yazi";
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
plugins = mkYaziPlugin "smart-enter" ''
|
||||
return {
|
||||
entry = function()
|
||||
local h = cx.active.current.hovered
|
||||
ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true })
|
||||
end,
|
||||
}
|
||||
'';
|
||||
keymap.manager.prepend_keymap = [
|
||||
{
|
||||
on = "l";
|
||||
run = "plugin --sync smart-enter";
|
||||
desc = "Enter the child directory, or open the file";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./fish.nix
|
||||
./starship.nix
|
||||
./zoxide.nix
|
||||
./nushell.nix
|
||||
./fish.nix
|
||||
];
|
||||
}
|
51
modules/hm/programs/terminal/shell/fish.nix
Normal file
51
modules/hm/programs/terminal/shell/fish.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
starshipTransient = lib.strings.optionalString config.programs.starship.enableTransience ''
|
||||
function starship_transient_prompt_func
|
||||
starship module character
|
||||
end
|
||||
|
||||
function starship_transient_rprompt_func
|
||||
starship module cmd_duration
|
||||
end
|
||||
'';
|
||||
in {
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit =
|
||||
starshipTransient
|
||||
+ ''
|
||||
set fish_greeting # Disable greeting
|
||||
fish_vi_key_bindings # Enable Vi mode
|
||||
|
||||
'';
|
||||
plugins = [
|
||||
{
|
||||
name = "fzf";
|
||||
inherit (pkgs.fishPlugins.fzf) src;
|
||||
}
|
||||
{
|
||||
name = "autopair";
|
||||
inherit (pkgs.fishPlugins.autopair) src;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
||||
then
|
||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
15
modules/hm/programs/terminal/shell/starship.nix
Normal file
15
modules/hm/programs/terminal/shell/starship.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableTransience = true;
|
||||
settings = {
|
||||
add_newline = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
12
modules/hm/programs/terminal/shell/zoxide.nix
Normal file
12
modules/hm/programs/terminal/shell/zoxide.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableBashIntegration = false;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -15,6 +15,9 @@ in {
|
|||
backupFileExtension = "backup";
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
extraSpecialArgs = {inherit inputs;};
|
||||
sharedModules = [../../hm];
|
||||
};
|
||||
|
||||
home-manager.users.${username} = {
|
||||
|
|
Loading…
Reference in a new issue