diff --git a/config/home-manager/default.nix b/config/home-manager/default.nix deleted file mode 100644 index c6bb600..0000000 --- a/config/home-manager/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -_: { - imports = [./terminal]; -} diff --git a/config/home-manager/terminal/default.nix b/config/home-manager/terminal/default.nix deleted file mode 100644 index dcf4368..0000000 --- a/config/home-manager/terminal/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -_: { - imports = [ - ./programs - ./shell - ]; - - home.sessionVariables = { - EDITOR = "nvim"; - }; -} diff --git a/config/home-manager/terminal/emulators/foot.nix b/config/home-manager/terminal/emulators/foot.nix deleted file mode 100644 index 5172de2..0000000 --- a/config/home-manager/terminal/emulators/foot.nix +++ /dev/null @@ -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}"; - }; - }; - }; -} diff --git a/config/home-manager/terminal/emulators/gnome-terminal.nix b/config/home-manager/terminal/emulators/gnome-terminal.nix deleted file mode 100644 index 42ba538..0000000 --- a/config/home-manager/terminal/emulators/gnome-terminal.nix +++ /dev/null @@ -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"; - }; - }; - }; -} diff --git a/config/home-manager/terminal/emulators/wezterm.nix b/config/home-manager/terminal/emulators/wezterm.nix deleted file mode 100644 index 70631f1..0000000 --- a/config/home-manager/terminal/emulators/wezterm.nix +++ /dev/null @@ -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'), - }, - } - ''; - }; -} diff --git a/config/home-manager/terminal/programs/bat.nix b/config/home-manager/terminal/programs/bat.nix deleted file mode 100644 index 4a7e8eb..0000000 --- a/config/home-manager/terminal/programs/bat.nix +++ /dev/null @@ -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"; - }; -} diff --git a/config/home-manager/terminal/programs/default.nix b/config/home-manager/terminal/programs/default.nix deleted file mode 100644 index 22e02a9..0000000 --- a/config/home-manager/terminal/programs/default.nix +++ /dev/null @@ -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 - ]; -} diff --git a/config/home-manager/terminal/programs/direnv.nix b/config/home-manager/terminal/programs/direnv.nix deleted file mode 100644 index bf4e94e..0000000 --- a/config/home-manager/terminal/programs/direnv.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs = { - direnv = { - enable = true; - nix-direnv.enable = true; - }; - }; -} diff --git a/config/home-manager/terminal/programs/git.nix b/config/home-manager/terminal/programs/git.nix deleted file mode 100644 index d452fa7..0000000 --- a/config/home-manager/terminal/programs/git.nix +++ /dev/null @@ -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"; - }; -} diff --git a/config/home-manager/terminal/programs/gnupg.nix b/config/home-manager/terminal/programs/gnupg.nix deleted file mode 100644 index 26a0a49..0000000 --- a/config/home-manager/terminal/programs/gnupg.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs.gpg.enable = true; - services.gpg-agent = { - enable = true; - enableBashIntegration = true; - enableFishIntegration = true; - }; -} diff --git a/config/home-manager/terminal/programs/nix-index.nix b/config/home-manager/terminal/programs/nix-index.nix deleted file mode 100644 index 04a55a2..0000000 --- a/config/home-manager/terminal/programs/nix-index.nix +++ /dev/null @@ -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; - }; -} diff --git a/config/home-manager/terminal/programs/tmux.nix b/config/home-manager/terminal/programs/tmux.nix deleted file mode 100644 index 7c08d03..0000000 --- a/config/home-manager/terminal/programs/tmux.nix +++ /dev/null @@ -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; -} diff --git a/config/home-manager/terminal/programs/yazi.nix b/config/home-manager/terminal/programs/yazi.nix deleted file mode 100644 index e439e7f..0000000 --- a/config/home-manager/terminal/programs/yazi.nix +++ /dev/null @@ -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"; - } - ]; - }; -} diff --git a/config/home-manager/terminal/shell/fish.nix b/config/home-manager/terminal/shell/fish.nix deleted file mode 100644 index 0e4e4f9..0000000 --- a/config/home-manager/terminal/shell/fish.nix +++ /dev/null @@ -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 - ''; - }; -} diff --git a/config/home-manager/terminal/shell/nushell.nix b/config/home-manager/terminal/shell/nushell.nix deleted file mode 100644 index 9cd0c78..0000000 --- a/config/home-manager/terminal/shell/nushell.nix +++ /dev/null @@ -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; - }; -} diff --git a/config/home-manager/terminal/shell/starship.nix b/config/home-manager/terminal/shell/starship.nix deleted file mode 100644 index 0ddba82..0000000 --- a/config/home-manager/terminal/shell/starship.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - programs.starship = { - enable = true; - enableTransience = true; - settings = { - add_newline = true; - }; - }; -} diff --git a/config/home-manager/terminal/shell/zoxide.nix b/config/home-manager/terminal/shell/zoxide.nix deleted file mode 100644 index 6317ebe..0000000 --- a/config/home-manager/terminal/shell/zoxide.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.zoxide = { - enable = true; - enableBashIntegration = false; - }; -} diff --git a/flake.lock b/flake.lock index 5c6c4b3..1795cb1 100644 --- a/flake.lock +++ b/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": { diff --git a/hosts/default.nix b/hosts/default.nix index 3c42986..3ac48e0 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -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]; }; } diff --git a/modules/hm/programs/default.nix b/modules/hm/programs/default.nix index 358daf8..49f08d0 100644 --- a/modules/hm/programs/default.nix +++ b/modules/hm/programs/default.nix @@ -4,6 +4,7 @@ ./editors ./hypr ./media + ./terminal ./games.nix ./gnome.nix diff --git a/modules/hm/programs/hypr/land/binds.nix b/modules/hm/programs/hypr/land/binds.nix index dddddcb..9b41ff1 100644 --- a/modules/hm/programs/hypr/land/binds.nix +++ b/modules/hm/programs/hypr/land/binds.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" diff --git a/modules/hm/programs/terminal/default.nix b/modules/hm/programs/terminal/default.nix new file mode 100644 index 0000000..59cc704 --- /dev/null +++ b/modules/hm/programs/terminal/default.nix @@ -0,0 +1,17 @@ +{ + lib, + osConfig, + ... +}: { + imports = [ + ./emulators + ./programs + ./shell + ]; + + config = lib.mkIf osConfig.local.profiles.desktop.enable { + home.sessionVariables = { + EDITOR = "nvim"; + }; + }; +} diff --git a/modules/hm/programs/terminal/emulators/default.nix b/modules/hm/programs/terminal/emulators/default.nix new file mode 100644 index 0000000..4f0ca1e --- /dev/null +++ b/modules/hm/programs/terminal/emulators/default.nix @@ -0,0 +1,3 @@ +{ + imports = [./foot.nix]; +} diff --git a/modules/hm/programs/terminal/emulators/foot.nix b/modules/hm/programs/terminal/emulators/foot.nix new file mode 100644 index 0000000..685b434 --- /dev/null +++ b/modules/hm/programs/terminal/emulators/foot.nix @@ -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}"; + }; + }; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/bat.nix b/modules/hm/programs/terminal/programs/bat.nix new file mode 100644 index 0000000..9ac81a0 --- /dev/null +++ b/modules/hm/programs/terminal/programs/bat.nix @@ -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"; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/default.nix b/modules/hm/programs/terminal/programs/default.nix new file mode 100644 index 0000000..8b56212 --- /dev/null +++ b/modules/hm/programs/terminal/programs/default.nix @@ -0,0 +1,12 @@ +{ + imports = [ + ./bat.nix + ./direnv.nix + ./git.nix + ./gnupg.nix + ./misc.nix + ./nix-index.nix + ./tmux.nix + ./yazi.nix + ]; +} diff --git a/modules/hm/programs/terminal/programs/direnv.nix b/modules/hm/programs/terminal/programs/direnv.nix new file mode 100644 index 0000000..89e35ba --- /dev/null +++ b/modules/hm/programs/terminal/programs/direnv.nix @@ -0,0 +1,14 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs = { + direnv = { + enable = true; + nix-direnv.enable = true; + }; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/git.nix b/modules/hm/programs/terminal/programs/git.nix new file mode 100644 index 0000000..455d541 --- /dev/null +++ b/modules/hm/programs/terminal/programs/git.nix @@ -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"; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/gnupg.nix b/modules/hm/programs/terminal/programs/gnupg.nix new file mode 100644 index 0000000..a800ef8 --- /dev/null +++ b/modules/hm/programs/terminal/programs/gnupg.nix @@ -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; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/misc.nix b/modules/hm/programs/terminal/programs/misc.nix new file mode 100644 index 0000000..b74aa4f --- /dev/null +++ b/modules/hm/programs/terminal/programs/misc.nix @@ -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 + ]; + }; +} diff --git a/modules/hm/programs/terminal/programs/nix-index.nix b/modules/hm/programs/terminal/programs/nix-index.nix new file mode 100644 index 0000000..372060d --- /dev/null +++ b/modules/hm/programs/terminal/programs/nix-index.nix @@ -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; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/tmux.nix b/modules/hm/programs/terminal/programs/tmux.nix new file mode 100644 index 0000000..da828e2 --- /dev/null +++ b/modules/hm/programs/terminal/programs/tmux.nix @@ -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; + }; +} diff --git a/modules/hm/programs/terminal/programs/yazi.nix b/modules/hm/programs/terminal/programs/yazi.nix new file mode 100644 index 0000000..3b60a2b --- /dev/null +++ b/modules/hm/programs/terminal/programs/yazi.nix @@ -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"; + } + ]; + }; + }; +} diff --git a/config/home-manager/terminal/shell/default.nix b/modules/hm/programs/terminal/shell/default.nix similarity index 80% rename from config/home-manager/terminal/shell/default.nix rename to modules/hm/programs/terminal/shell/default.nix index 53f04c4..3910822 100644 --- a/config/home-manager/terminal/shell/default.nix +++ b/modules/hm/programs/terminal/shell/default.nix @@ -1,8 +1,7 @@ { imports = [ + ./fish.nix ./starship.nix ./zoxide.nix - ./nushell.nix - ./fish.nix ]; } diff --git a/modules/hm/programs/terminal/shell/fish.nix b/modules/hm/programs/terminal/shell/fish.nix new file mode 100644 index 0000000..fc66325 --- /dev/null +++ b/modules/hm/programs/terminal/shell/fish.nix @@ -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 + ''; + }; + }; +} diff --git a/modules/hm/programs/terminal/shell/starship.nix b/modules/hm/programs/terminal/shell/starship.nix new file mode 100644 index 0000000..f70c521 --- /dev/null +++ b/modules/hm/programs/terminal/shell/starship.nix @@ -0,0 +1,15 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.starship = { + enable = true; + enableTransience = true; + settings = { + add_newline = true; + }; + }; + }; +} diff --git a/modules/hm/programs/terminal/shell/zoxide.nix b/modules/hm/programs/terminal/shell/zoxide.nix new file mode 100644 index 0000000..63f3106 --- /dev/null +++ b/modules/hm/programs/terminal/shell/zoxide.nix @@ -0,0 +1,12 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.zoxide = { + enable = true; + enableBashIntegration = false; + }; + }; +} diff --git a/modules/nix/core/home-manager.nix b/modules/nix/core/home-manager.nix index c1f3655..c8befd6 100644 --- a/modules/nix/core/home-manager.nix +++ b/modules/nix/core/home-manager.nix @@ -15,6 +15,9 @@ in { backupFileExtension = "backup"; useGlobalPkgs = true; useUserPackages = true; + + extraSpecialArgs = {inherit inputs;}; + sharedModules = [../../hm]; }; home-manager.users.${username} = {