From 1f5dfe56018257f0c419c5180c9d90376b68ff8b Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:47:57 -0500 Subject: [PATCH 01/13] Move custom home-manager module options to hm. --- modules/home-manager/modules/1password/common.nix | 6 +++--- modules/home-manager/modules/1password/darwin.nix | 2 +- modules/home-manager/modules/1password/linux.nix | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/home-manager/modules/1password/common.nix b/modules/home-manager/modules/1password/common.nix index 6e8dd17..1af3adf 100644 --- a/modules/home-manager/modules/1password/common.nix +++ b/modules/home-manager/modules/1password/common.nix @@ -2,14 +2,14 @@ let inherit (lib) mkOption types; - cfg = config._1password; + cfg = config.hm._1password; in { options = { - _1password.sockPath = mkOption { + hm._1password.sockPath = mkOption { type = types.str; }; - _1password.sshProgram = mkOption { + hm._1password.sshProgram = mkOption { type = types.str; }; }; diff --git a/modules/home-manager/modules/1password/darwin.nix b/modules/home-manager/modules/1password/darwin.nix index ad8c5e6..5f6dd2e 100644 --- a/modules/home-manager/modules/1password/darwin.nix +++ b/modules/home-manager/modules/1password/darwin.nix @@ -3,7 +3,7 @@ { imports = [ ./common.nix ]; - _1password = { + hm._1password = { sockPath = "${config.home.homeDirectory}/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"; sshProgram = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"; }; diff --git a/modules/home-manager/modules/1password/linux.nix b/modules/home-manager/modules/1password/linux.nix index 3f70087..d96e547 100644 --- a/modules/home-manager/modules/1password/linux.nix +++ b/modules/home-manager/modules/1password/linux.nix @@ -3,7 +3,7 @@ { imports = [ ./common.nix ]; - _1password = { + hm._1password = { sockPath = "${config.home.homeDirectory}/.1password/agent.sock"; sshProgram = "/run/current-system/sw/bin/op-ssh-sign"; }; From c246459658eaf2d227e072ca0fd028880388b617 Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:48:49 -0500 Subject: [PATCH 02/13] Move setopt completealiases to base zsh config --- modules/home-manager/modules/1password/common.nix | 2 -- modules/home-manager/modules/zsh/common.nix | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/home-manager/modules/1password/common.nix b/modules/home-manager/modules/1password/common.nix index 1af3adf..0980275 100644 --- a/modules/home-manager/modules/1password/common.nix +++ b/modules/home-manager/modules/1password/common.nix @@ -32,8 +32,6 @@ in zsh = { initExtra = '' SSH_AUTH_SOCK="${cfg.sockPath}" - # This is needed for autocompletion to work with op plugin - setopt completealiases ''; shellAliases = { gh = "op plugin run -- gh"; diff --git a/modules/home-manager/modules/zsh/common.nix b/modules/home-manager/modules/zsh/common.nix index 5d688ad..2a0f2fd 100644 --- a/modules/home-manager/modules/zsh/common.nix +++ b/modules/home-manager/modules/zsh/common.nix @@ -6,6 +6,9 @@ enable = true; historySubstringSearch.enable = true; initExtra = '' + # This is needed for autocompletion to work with aliases + setopt completealiases + bindkey '^U' backward-kill-line ''; }; From 7a484bf548c27ca7553583523ca190ce2dcb694e Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:58:30 -0500 Subject: [PATCH 03/13] Use proper way to set session variable for SSH_AUTH_SOCK --- modules/home-manager/modules/1password/common.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/modules/1password/common.nix b/modules/home-manager/modules/1password/common.nix index 0980275..f514b35 100644 --- a/modules/home-manager/modules/1password/common.nix +++ b/modules/home-manager/modules/1password/common.nix @@ -15,6 +15,8 @@ in }; config = { + home.sessionVariables.SSH_AUTH_SOCK = "${cfg.sockPath}"; + programs = { git.extraConfig = { commit.gpgsign = true; @@ -30,9 +32,6 @@ in ''; zsh = { - initExtra = '' - SSH_AUTH_SOCK="${cfg.sockPath}" - ''; shellAliases = { gh = "op plugin run -- gh"; }; From 74f444307c38efa107a391d76b72098fe133a101 Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:59:56 -0500 Subject: [PATCH 04/13] Only enable gh op plugin if gh is enabled --- modules/home-manager/modules/1password/common.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/home-manager/modules/1password/common.nix b/modules/home-manager/modules/1password/common.nix index f514b35..f2a9b43 100644 --- a/modules/home-manager/modules/1password/common.nix +++ b/modules/home-manager/modules/1password/common.nix @@ -31,10 +31,8 @@ in IdentityAgent "${cfg.sockPath}" ''; - zsh = { - shellAliases = { - gh = "op plugin run -- gh"; - }; + zsh.shellAliases = { + gh = lib.mkIf config.programs.gh.enable "op plugin run -- gh"; }; }; }; From 0c27f1a0757b9c24ab1429cbda535bc14a97ca35 Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Sat, 4 Jan 2025 17:11:00 -0500 Subject: [PATCH 05/13] Fix delta theme --- modules/home-manager/modules/git.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/modules/git.nix b/modules/home-manager/modules/git.nix index 909d6e2..59631f2 100644 --- a/modules/home-manager/modules/git.nix +++ b/modules/home-manager/modules/git.nix @@ -37,7 +37,6 @@ line-numbers = true; navigate = true; side-by-side = true; - theme = "Nord"; }; }; }; @@ -72,4 +71,15 @@ zsh.shellAliases.lg = "${pkgs.lazygit}/bin/lazygit"; }; + + + # delta themes config + xdg.configFile."git/delta/themes.gitconfig" = { + source = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/dandavison/delta/ef3e1be569bf076f035327342939bd9d7c8908bd/themes.gitconfig"; + sha256 = "sha256-NBALeGfKhgDbCqzBVirC0886P0CCVvAH3Pf3NvVg4KM="; + }; + }; + programs.git.extraConfig.include.path = "delta/themes.gitconfig"; + programs.git.delta.options.features = "arctic-fox"; } From 57ee993fb87ec4e0bc97db2e3efa3fc47327db1e Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Sat, 4 Jan 2025 17:11:16 -0500 Subject: [PATCH 06/13] Ensure we use the proper package for lazygit alias --- modules/home-manager/modules/git.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/modules/git.nix b/modules/home-manager/modules/git.nix index 59631f2..aa38828 100644 --- a/modules/home-manager/modules/git.nix +++ b/modules/home-manager/modules/git.nix @@ -69,7 +69,7 @@ }; }; - zsh.shellAliases.lg = "${pkgs.lazygit}/bin/lazygit"; + zsh.shellAliases.lg = "${config.programs.lazygit.package}/bin/lazygit"; }; From a684a38886e07961fcf48033cd928e3d35485283 Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Mon, 6 Jan 2025 11:03:34 -0500 Subject: [PATCH 07/13] Move configs to their own directory These are for more complicated configs that use configs in different languages. --- modules/home-manager/flake-module.nix | 4 ++-- .../home-manager/modules/{wezterm.nix => wezterm/default.nix} | 2 +- .../home-manager/modules/{zellij.nix => zellij/default.nix} | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename modules/home-manager/modules/{wezterm.nix => wezterm/default.nix} (61%) rename modules/home-manager/modules/{zellij.nix => zellij/default.nix} (91%) diff --git a/modules/home-manager/flake-module.nix b/modules/home-manager/flake-module.nix index bb057f3..93f0234 100644 --- a/modules/home-manager/flake-module.nix +++ b/modules/home-manager/flake-module.nix @@ -22,9 +22,9 @@ ./modules/starship.nix ./modules/terminal.nix ./modules/vscode.nix - ./modules/wezterm.nix + ./modules/wezterm ./modules/yazi.nix - ./modules/zellij.nix + ./modules/zellij ./modules/zoxide.nix ]; home.stateVersion = "22.11"; diff --git a/modules/home-manager/modules/wezterm.nix b/modules/home-manager/modules/wezterm/default.nix similarity index 61% rename from modules/home-manager/modules/wezterm.nix rename to modules/home-manager/modules/wezterm/default.nix index c58a0b7..98dd8e8 100644 --- a/modules/home-manager/modules/wezterm.nix +++ b/modules/home-manager/modules/wezterm/default.nix @@ -4,6 +4,6 @@ programs.wezterm = { enable = true; enableZshIntegration = true; - extraConfig = builtins.readFile ./wezterm/wezterm.lua; + extraConfig = builtins.readFile ./wezterm.lua; }; } diff --git a/modules/home-manager/modules/zellij.nix b/modules/home-manager/modules/zellij/default.nix similarity index 91% rename from modules/home-manager/modules/zellij.nix rename to modules/home-manager/modules/zellij/default.nix index 8fd1580..043a3e8 100644 --- a/modules/home-manager/modules/zellij.nix +++ b/modules/home-manager/modules/zellij/default.nix @@ -15,6 +15,6 @@ xdg.configFile."zellij/layouts" = { recursive = true; - source = ./zellij/layouts; + source = ./layouts; }; } From b832eb893df2baa71eae227141df9cb377f57892 Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Mon, 6 Jan 2025 11:04:36 -0500 Subject: [PATCH 08/13] Remove fzf_with_hx function I want to use proper zle widgets instead. Will get there someday. --- modules/home-manager/modules/fzf.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/home-manager/modules/fzf.nix b/modules/home-manager/modules/fzf.nix index 52c3574..e2458a2 100644 --- a/modules/home-manager/modules/fzf.nix +++ b/modules/home-manager/modules/fzf.nix @@ -1,13 +1,7 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, ... }: let fd = "${config.programs.fd.package}/bin/fd"; fileCommand = "${fd} --type=file"; - openWithHx = '' - fzf_with_hx() { - ${config.programs.fzf.package}/bin/fzf --multi --bind 'enter:become(${config.programs.helix.package}/bin/hx {+})' - } - bindkey -s '^o' 'fzf_with_hx\n' - ''; in { home.packages = [ pkgs.zsh-fzf-tab ]; @@ -44,7 +38,9 @@ in }; zsh.initExtra = '' source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh + + # fzf-tab does not take default options into consideration so we have to set the height directly zstyle ':fzf-tab:*' fzf-flags --height=40% - '' + lib.optionalString (config.programs.helix.enable) openWithHx; + ''; }; } From ab437776289c87deb1bc444eea537a72836fd712 Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Mon, 6 Jan 2025 11:04:47 -0500 Subject: [PATCH 09/13] Add TODO --- modules/home-manager/modules/alacritty.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/home-manager/modules/alacritty.nix b/modules/home-manager/modules/alacritty.nix index 0663f42..47a1b98 100644 --- a/modules/home-manager/modules/alacritty.nix +++ b/modules/home-manager/modules/alacritty.nix @@ -5,6 +5,7 @@ enable = false; settings = { # Nord theme taken from: https://github.com/alacritty/alacritty-theme/blob/95a7d695605863ede5b7430eb80d9e80f5f504bc/themes/nord.toml + # TODO: use fetchUrl colors = { primary = { background = "#2E3440"; From 040f8e2469fc86020a998a5a1cd883df16fd5ab6 Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:04:15 -0500 Subject: [PATCH 10/13] Wezterm front_end bug seems to be fixed --- modules/home-manager/modules/wezterm/wezterm.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/home-manager/modules/wezterm/wezterm.lua b/modules/home-manager/modules/wezterm/wezterm.lua index b9f8614..2111e07 100644 --- a/modules/home-manager/modules/wezterm/wezterm.lua +++ b/modules/home-manager/modules/wezterm/wezterm.lua @@ -17,8 +17,6 @@ config.color_scheme = "nord" config.font = wezterm.font("FiraCode Nerd Font") config.font_size = 14.0 -config.front_end = "WebGpu" - config.window_close_confirmation = "NeverPrompt" config.window_decorations = "RESIZE" From 91129a444199371a9b14ebfae73df1e42563ca5d Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:38:40 -0500 Subject: [PATCH 11/13] No issue with individual flakes --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index 01e919c..181ab3b 100644 --- a/justfile +++ b/justfile @@ -10,7 +10,7 @@ darwin-rebuild: @darwin-rebuild switch --flake .# update: - @nix flake update nixpkgs nix-darwin home-manager treefmt-nix flake-parts + @nix flake update format: @nix fmt From 16ab22619d3290d56215d09a51c7dd4f98a35a85 Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Wed, 8 Jan 2025 20:50:24 -0500 Subject: [PATCH 12/13] Configure ripgrep with good defaults --- modules/home-manager/modules/ripgrep.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/modules/ripgrep.nix b/modules/home-manager/modules/ripgrep.nix index cfe1350..9268cf0 100644 --- a/modules/home-manager/modules/ripgrep.nix +++ b/modules/home-manager/modules/ripgrep.nix @@ -3,5 +3,12 @@ { home.packages = [ pkgs.repgrep ]; - programs.ripgrep.enable = true; + programs.ripgrep = { + enable = true; + arguments = [ + "--smart-case" + "--hidden" + "--glob=!.git/*" + ]; + }; } From 3359f510c987d32dbefd3820feadf91dc770df57 Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Wed, 8 Jan 2025 20:50:57 -0500 Subject: [PATCH 13/13] nix flake update --- flake.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/flake.lock b/flake.lock index 1c00dca..f66bd75 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1735468753, - "narHash": "sha256-2dt1nOe9zf9pDkf5Kn7FUFyPRo581s0n90jxYXJ94l0=", + "lastModified": 1736199437, + "narHash": "sha256-TdU0a/x8048rbbJmkKWzSY1CtsbbGKNkIJcMdr8Zf4Q=", "owner": "nix-community", "repo": "disko", - "rev": "84a5b93637cc16cbfcc61b6e1684d626df61eb21", + "rev": "49f8aa791f81ff2402039b3efe0c35b9386c4bcf", "type": "github" }, "original": { @@ -25,11 +25,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "lastModified": 1736143030, + "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", "type": "github" }, "original": { @@ -45,11 +45,11 @@ ] }, "locked": { - "lastModified": 1734622215, - "narHash": "sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI=", + "lastModified": 1736354372, + "narHash": "sha256-etLMa2BWCXWhG8WKyjsylvu+uskpJ4dQ+K8N0wEr5vc=", "owner": "nix-community", "repo": "home-manager", - "rev": "1395379a7a36e40f2a76e7b9936cc52950baa1be", + "rev": "54b330ac067e74314f8ca6b38af6fcfbd17f3e9e", "type": "github" }, "original": { @@ -65,11 +65,11 @@ ] }, "locked": { - "lastModified": 1733570843, - "narHash": "sha256-sQJAxY1TYWD1UyibN/FnN97paTFuwBw3Vp3DNCyKsMk=", + "lastModified": 1736085891, + "narHash": "sha256-bTl9fcUo767VaSx4Q5kFhwiDpFQhBKna7lNbGsqCQiA=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "a35b08d09efda83625bef267eb24347b446c80b8", + "rev": "ba9b3173b0f642ada42b78fb9dfc37ca82266f6c", "type": "github" }, "original": { @@ -81,11 +81,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1734424634, - "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", + "lastModified": 1736012469, + "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", + "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "type": "github" }, "original": { @@ -97,14 +97,14 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1733096140, - "narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=", + "lastModified": 1735774519, + "narHash": "sha256-CewEm1o2eVAnoqb6Ml+Qi9Gg/EfNAxbRx1lANGVyoLI=", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" }, "original": { "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" } }, "root": { @@ -124,11 +124,11 @@ ] }, "locked": { - "lastModified": 1734543842, - "narHash": "sha256-/QceWozrNg915Db9x/Ie5k67n9wKgGdTFng+Z1Qw0kE=", + "lastModified": 1736154270, + "narHash": "sha256-p2r8xhQZ3TYIEKBoiEhllKWQqWNJNoT9v64Vmg4q8Zw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "76159fc74eeac0599c3618e3601ac2b980a29263", + "rev": "13c913f5deb3a5c08bb810efd89dc8cb24dd968b", "type": "github" }, "original": {