From 641ef5f9c82fd2fa5c43c6b08968891e8e0044b2 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 12 Jan 2026 14:54:11 +0000 Subject: [PATCH 01/20] treewide: remove unused 'with pkgs' --- modules/home/calibre/default.nix | 2 +- modules/home/gdb/default.nix | 2 +- modules/home/trgui/default.nix | 2 +- templates/c++-cmake/flake.nix | 2 +- templates/c++-meson/flake.nix | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/home/calibre/default.nix b/modules/home/calibre/default.nix index de7c1263..fcd62f86 100644 --- a/modules/home/calibre/default.nix +++ b/modules/home/calibre/default.nix @@ -10,7 +10,7 @@ in }; config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ + home.packages = [ cfg.package ]; }; diff --git a/modules/home/gdb/default.nix b/modules/home/gdb/default.nix index 1ffc6bd9..b7c3aca5 100644 --- a/modules/home/gdb/default.nix +++ b/modules/home/gdb/default.nix @@ -17,7 +17,7 @@ in config = lib.mkIf cfg.enable (lib.mkMerge [ { - home.packages = with pkgs; [ + home.packages = [ cfg.package ]; diff --git a/modules/home/trgui/default.nix b/modules/home/trgui/default.nix index ee545a98..63df3550 100644 --- a/modules/home/trgui/default.nix +++ b/modules/home/trgui/default.nix @@ -10,7 +10,7 @@ in }; config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ + home.packages = [ cfg.package ]; }; diff --git a/templates/c++-cmake/flake.nix b/templates/c++-cmake/flake.nix index 7796f5e5..eb2767d6 100644 --- a/templates/c++-cmake/flake.nix +++ b/templates/c++-cmake/flake.nix @@ -95,7 +95,7 @@ self.packages.${system}.project ]; - packages = with pkgs; [ + packages = [ self.checks.${system}.pre-commit.enabledPackages ]; diff --git a/templates/c++-meson/flake.nix b/templates/c++-meson/flake.nix index cb14eb56..44189179 100644 --- a/templates/c++-meson/flake.nix +++ b/templates/c++-meson/flake.nix @@ -95,7 +95,7 @@ self.packages.${system}.project ]; - packages = with pkgs; [ + packages = [ self.checks.${system}.pre-commit.enabledPackages ]; From 49f938f43202bd6bc87efd62bc6b346966c61951 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 26 Jan 2026 17:52:23 +0000 Subject: [PATCH 02/20] treewide: remove redundant 'builtins' I keep forgetting `map` and `removeAttrs` are included at the top-level in the prelude. --- modules/home/mail/accounts/default.nix | 2 +- modules/home/wm/i3bar/default.nix | 2 +- modules/nixos/programs/steam/default.nix | 2 +- modules/nixos/services/backup/default.nix | 2 +- modules/nixos/services/nginx/default.nix | 6 +++--- overlays/default.nix | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/home/mail/accounts/default.nix b/modules/home/mail/accounts/default.nix index 5216ad5e..ca5e6ea6 100644 --- a/modules/home/mail/accounts/default.nix +++ b/modules/home/mail/accounts/default.nix @@ -11,7 +11,7 @@ let lib.mkDefault [ (lib.getExe pkgs.ambroisie.rbw-pass) "Mail" passName ]; address = mkMailAddress address domain; - aliases = builtins.map (lib.flip mkMailAddress domain) aliases; + aliases = map (lib.flip mkMailAddress domain) aliases; inherit primary; diff --git a/modules/home/wm/i3bar/default.nix b/modules/home/wm/i3bar/default.nix index 5ae0e7d7..28c19355 100644 --- a/modules/home/wm/i3bar/default.nix +++ b/modules/home/wm/i3bar/default.nix @@ -69,7 +69,7 @@ in inactive_state = "Idle"; }; in - builtins.map (block: defaults // block) cfg.vpn.blockConfigs + map (block: defaults // block) cfg.vpn.blockConfigs ) ) { diff --git a/modules/nixos/programs/steam/default.nix b/modules/nixos/programs/steam/default.nix index 0c7f9dad..c859bdb2 100644 --- a/modules/nixos/programs/steam/default.nix +++ b/modules/nixos/programs/steam/default.nix @@ -23,7 +23,7 @@ in enable = true; }; - environment.systemPackages = builtins.map lib.hiPrio [ + environment.systemPackages = map lib.hiPrio [ # Respect XDG conventions, leave my HOME alone (pkgs.writeShellScriptBin "steam" '' mkdir -p "${cfg.dataDir}" diff --git a/modules/nixos/services/backup/default.nix b/modules/nixos/services/backup/default.nix index 8aeeae19..79884063 100644 --- a/modules/nixos/services/backup/default.nix +++ b/modules/nixos/services/backup/default.nix @@ -96,7 +96,7 @@ in # Contains the UID/GID map, and other useful state "/var/lib/nixos" # SSH host keys (and public keys for convenience) - (builtins.map (key: [ key.path "${key.path}.pub" ]) config.services.openssh.hostKeys) + (map (key: [ key.path "${key.path}.pub" ]) config.services.openssh.hostKeys) ]; services.restic.backups.backblaze = { diff --git a/modules/nixos/services/nginx/default.nix b/modules/nixos/services/nginx/default.nix index ff530b0a..153a299f 100644 --- a/modules/nixos/services/nginx/default.nix +++ b/modules/nixos/services/nginx/default.nix @@ -188,14 +188,14 @@ in ++ (lib.flip lib.mapAttrsToList cfg.virtualHosts (_: { subdomain, ... } @ args: let conflicts = [ "port" "root" "socket" "redirect" ]; - optionsNotNull = builtins.map (v: args.${v} != null) conflicts; + optionsNotNull = map (v: args.${v} != null) conflicts; optionsSet = lib.filter lib.id optionsNotNull; in { assertion = builtins.length optionsSet == 1; message = '' Subdomain '${subdomain}' must have exactly one of ${ - lib.concatStringsSep ", " (builtins.map (v: "'${v}'") conflicts) + lib.concatStringsSep ", " (map (v: "'${v}'") conflicts) } configured. ''; })) @@ -208,7 +208,7 @@ in assertion = args.websocketsLocations != [ ] -> proxyPassUsed; message = '' Subdomain '${subdomain}' can only use 'websocketsLocations' with one of ${ - lib.concatStringsSep ", " (builtins.map (v: "'${v}'") proxyPass) + lib.concatStringsSep ", " (map (v: "'${v}'") proxyPass) }. ''; })) diff --git a/overlays/default.nix b/overlays/default.nix index 683e021b..d3e30aa8 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,6 +1,6 @@ # Automatically import all overlays in the directory let files = builtins.readDir ./.; - overlays = builtins.removeAttrs files [ "default.nix" ]; + overlays = removeAttrs files [ "default.nix" ]; in builtins.mapAttrs (name: _: import "${./.}/${name}") overlays From ad51d9fd4c982058ee03792c89d82fcfe4895832 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 12 Jan 2026 14:55:47 +0000 Subject: [PATCH 03/20] nixos: services: servarr: remove redundant 'lib' My personal style preference (currently) is to use `with lib` on option declarations, avoiding the `lib` prefix. --- modules/nixos/services/servarr/bazarr.nix | 2 +- modules/nixos/services/servarr/jackett.nix | 2 +- modules/nixos/services/servarr/nzbhydra.nix | 2 +- modules/nixos/services/servarr/prowlarr.nix | 2 +- modules/nixos/services/servarr/starr.nix | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/nixos/services/servarr/bazarr.nix b/modules/nixos/services/servarr/bazarr.nix index 637da0c7..67d34169 100644 --- a/modules/nixos/services/servarr/bazarr.nix +++ b/modules/nixos/services/servarr/bazarr.nix @@ -4,7 +4,7 @@ let in { options.my.services.servarr.bazarr = with lib; { - enable = lib.mkEnableOption "Bazarr" // { + enable = mkEnableOption "Bazarr" // { default = config.my.services.servarr.enableAll; }; diff --git a/modules/nixos/services/servarr/jackett.nix b/modules/nixos/services/servarr/jackett.nix index 481cd3de..8e8a5c3e 100644 --- a/modules/nixos/services/servarr/jackett.nix +++ b/modules/nixos/services/servarr/jackett.nix @@ -4,7 +4,7 @@ let in { options.my.services.servarr.jackett = with lib; { - enable = lib.mkEnableOption "Jackett" // { + enable = mkEnableOption "Jackett" // { default = config.my.services.servarr.enableAll; }; diff --git a/modules/nixos/services/servarr/nzbhydra.nix b/modules/nixos/services/servarr/nzbhydra.nix index 7b639869..f2f82ac2 100644 --- a/modules/nixos/services/servarr/nzbhydra.nix +++ b/modules/nixos/services/servarr/nzbhydra.nix @@ -4,7 +4,7 @@ let in { options.my.services.servarr.nzbhydra = with lib; { - enable = lib.mkEnableOption "NZBHydra2" // { + enable = mkEnableOption "NZBHydra2" // { default = config.my.services.servarr.enableAll; }; }; diff --git a/modules/nixos/services/servarr/prowlarr.nix b/modules/nixos/services/servarr/prowlarr.nix index ce044c63..6825843c 100644 --- a/modules/nixos/services/servarr/prowlarr.nix +++ b/modules/nixos/services/servarr/prowlarr.nix @@ -5,7 +5,7 @@ let in { options.my.services.servarr.prowlarr = with lib; { - enable = lib.mkEnableOption "Prowlarr" // { + enable = mkEnableOption "Prowlarr" // { default = config.my.services.servarr.enableAll; }; diff --git a/modules/nixos/services/servarr/starr.nix b/modules/nixos/services/servarr/starr.nix index 2bf7c114..0ccdaa42 100644 --- a/modules/nixos/services/servarr/starr.nix +++ b/modules/nixos/services/servarr/starr.nix @@ -12,7 +12,7 @@ let in { options.my.services.servarr.${starr} = with lib; { - enable = lib.mkEnableOption (lib.toSentenceCase starr) // { + enable = mkEnableOption (lib.toSentenceCase starr) // { default = config.my.services.servarr.enableAll; }; From 39d393e7c9b8742b99d1605b6d9ac289d3fc17a3 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 26 Jan 2026 17:55:52 +0000 Subject: [PATCH 04/20] flake: checks: enable 'nixf-diagnose' --- flake/checks.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flake/checks.nix b/flake/checks.nix index 73e64d52..01d3c7a5 100644 --- a/flake/checks.nix +++ b/flake/checks.nix @@ -15,6 +15,10 @@ enable = true; }; + nixf-diagnose = { + enable = true; + }; + nixpkgs-fmt = { enable = true; }; From 0bedd5ce7107a1a5048df1f16f5e31f2605772e5 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 19 Jan 2026 12:10:17 +0000 Subject: [PATCH 05/20] home: calibre: use upstream module --- modules/home/calibre/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/home/calibre/default.nix b/modules/home/calibre/default.nix index fcd62f86..e3733b10 100644 --- a/modules/home/calibre/default.nix +++ b/modules/home/calibre/default.nix @@ -10,8 +10,10 @@ in }; config = lib.mkIf cfg.enable { - home.packages = [ - cfg.package - ]; + programs.calibre = { + enable = true; + + inherit (cfg) package; + }; }; } From b33d79d6a37651a3222b642ec2f7acf651c33a6b Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 17 Nov 2025 12:31:19 +0000 Subject: [PATCH 06/20] pkgs: diff-flake: add nix-darwin support --- pkgs/diff-flake/diff-flake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pkgs/diff-flake/diff-flake b/pkgs/diff-flake/diff-flake index a2a35131..7a46151a 100755 --- a/pkgs/diff-flake/diff-flake +++ b/pkgs/diff-flake/diff-flake @@ -24,6 +24,10 @@ current_system() { nix eval --raw --impure --expr 'builtins.currentSystem' } +add_darwin() { + FLAKE_OUTPUTS+=("darwinConfigurations.\"$1\".config.system.build.toplevel") +} + add_home() { FLAKE_OUTPUTS+=("homeConfigurations.\"$1\".activationPackage") } @@ -54,6 +58,10 @@ usage() { print_err " -p, --previous-rev" print_err " which git revision should be considered the 'previous' state," print_err " defaults to HEAD~" + print_err " --darwin [name]" + print_err " specify the name of a nix-darwin output configuration whose" + print_err " closure should be diffed, can be used multiple times" + print_err " if no host name is given, defaults to current hostname" print_err " --home [name]" print_err " specify the name of a home-manager output configuration whose" print_err " closure should be diffed, can be used multiple times" @@ -101,6 +109,14 @@ parse_args() { PREVIOUS_REV="$(git rev-parse "$1")" shift ;; + --darwin) + if [ $# -gt 0 ] && ! is_option "$1"; then + add_darwin "$1" + shift + else + add_darwin "$(hostname)" + fi + ;; --home) if [ $# -gt 0 ] && ! is_option "$1"; then add_home "$1" @@ -138,6 +154,12 @@ parse_args() { done } +list_darwin_configurations() { + nix eval '.#darwinConfigurations' \ + --apply 'attrs: with builtins; concatStringsSep "\n" (attrNames attrs)' \ + --raw +} + list_home_configurations() { nix eval '.#homeConfigurations' \ --apply 'attrs: with builtins; concatStringsSep "\n" (attrNames attrs)' \ @@ -175,6 +197,9 @@ diff_output() { parse_args "$@" if [ "${#FLAKE_OUTPUTS[@]}" -eq 0 ]; then + for darwin in $(list_darwin_configurations); do + add_darwin "$darwin" + done for home in $(list_home_configurations); do add_home "$home" done From 46b52cda53d664d8e91fcf9e17d045e59337bdf2 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 17 Nov 2025 12:40:21 +0000 Subject: [PATCH 07/20] pkgs: diff-flake: add system-manager support --- pkgs/diff-flake/diff-flake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pkgs/diff-flake/diff-flake b/pkgs/diff-flake/diff-flake index 7a46151a..bacee6ed 100755 --- a/pkgs/diff-flake/diff-flake +++ b/pkgs/diff-flake/diff-flake @@ -41,6 +41,10 @@ add_shell() { FLAKE_OUTPUTS+=("devShells.\"$(current_system)\".\"$1\".inputDerivation") } +add_system() { + FLAKE_OUTPUTS+=("systemConfigs.\"$1\".config.system.build.toplevel") +} + usage() { print_err "Usage: $0 [option]... [-- [nix build option]...]" print_err "" @@ -74,6 +78,10 @@ usage() { print_err " specify a specific devShell configuration name whose closure" print_err " should be diffed, can be used multiple times" print_err " if no name is given, defaults to 'default'" + print_err " --system [name]" + print_err " specify the name of a system-manager output configuration whose" + print_err " closure should be diffed, can be used multiple times" + print_err " if no host name is given, defaults to current hostname" print_err "" print_err "when no flake outputs are specified, automatically queries for" print_err "all NixOS configurations, and devShells for current system" @@ -141,6 +149,14 @@ parse_args() { add_shell "default" fi ;; + --system) + if [ $# -gt 0 ] && ! is_option "$1"; then + add_system "$1" + shift + else + add_system "$(hostname)" + fi + ;; --) NIX_BUILD_ARGS=("$@") break @@ -178,6 +194,12 @@ list_dev_shells() { --raw } +list_system_configurations() { + nix eval '.#systemConfigs' \ + --apply 'attrs: with builtins; concatStringsSep "\n" (attrNames attrs)' \ + --raw +} + diff_output() { local PREV NEW PREV="$(mktemp --dry-run)" @@ -209,6 +231,9 @@ if [ "${#FLAKE_OUTPUTS[@]}" -eq 0 ]; then for shell in $(list_dev_shells); do add_shell "$shell" done + for system in $(list_system_configurations); do + add_system "$system" + done fi for out in "${FLAKE_OUTPUTS[@]}"; do From c0f398e868cfce4506ae88f91b2d5b9bf682d94a Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 17 Nov 2025 12:42:03 +0000 Subject: [PATCH 08/20] pkgs: diff-flake: rename 'host' to 'nixos' To avoid mixing them up with Nix-Darwin and System Manager hosts. --- pkgs/diff-flake/diff-flake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/diff-flake/diff-flake b/pkgs/diff-flake/diff-flake index bacee6ed..f9290b91 100755 --- a/pkgs/diff-flake/diff-flake +++ b/pkgs/diff-flake/diff-flake @@ -32,7 +32,7 @@ add_home() { FLAKE_OUTPUTS+=("homeConfigurations.\"$1\".activationPackage") } -add_host() { +add_nixos() { FLAKE_OUTPUTS+=("nixosConfigurations.\"$1\".config.system.build.toplevel") } @@ -70,7 +70,7 @@ usage() { print_err " specify the name of a home-manager output configuration whose" print_err " closure should be diffed, can be used multiple times" print_err " if no configuration name is given, defaults to current username" - print_err " --host [name]" + print_err " --nixos [name]" print_err " specify the name of a NixOS output configuration whose" print_err " closure should be diffed, can be used multiple times" print_err " if no host name is given, defaults to current hostname" @@ -133,12 +133,12 @@ parse_args() { add_home "$USER" fi ;; - --host) + --nixos) if [ $# -gt 0 ] && ! is_option "$1"; then - add_host "$1" + add_nixos "$1" shift else - add_host "$(hostname)" + add_nixos "$(hostname)" fi ;; --shell) @@ -225,8 +225,8 @@ if [ "${#FLAKE_OUTPUTS[@]}" -eq 0 ]; then for home in $(list_home_configurations); do add_home "$home" done - for host in $(list_nixos_configurations); do - add_host "$host" + for nixos in $(list_nixos_configurations); do + add_nixos "$nixos" done for shell in $(list_dev_shells); do add_shell "$shell" From 8b83b5be5e9bca5ff9a609e3f2bdf2ded9aa4e08 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 26 Feb 2025 10:51:31 +0000 Subject: [PATCH 09/20] home: add jujutsu This is a very basic configuration, still missing most bells and whistles. --- modules/home/default.nix | 1 + modules/home/jujutsu/default.nix | 67 ++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 modules/home/jujutsu/default.nix diff --git a/modules/home/default.nix b/modules/home/default.nix index ad3b9791..eb3d0f29 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -24,6 +24,7 @@ ./gtk ./htop ./jq + ./jujutsu ./keyboard ./mail ./mpv diff --git a/modules/home/jujutsu/default.nix b/modules/home/jujutsu/default.nix new file mode 100644 index 00000000..eaf56e9d --- /dev/null +++ b/modules/home/jujutsu/default.nix @@ -0,0 +1,67 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.my.home.jujutsu; + + inherit (lib.my) mkMailAddress; +in +{ + options.my.home.jujutsu = with lib; { + enable = my.mkDisableOption "jujutsu configuration"; + + package = mkPackageOption pkgs "jujutsu" { }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + { + # For `jj git` commands + assertion = cfg.enable -> config.my.home.git.enable; + message = '' + `config.my.home.jujutsu` relies on `config.my.home.git` being enabled. + ''; + } + ]; + + programs.jujutsu = { + enable = true; + + inherit (cfg) package; + + settings = { + # Who am I? + user = { + name = "Bruno BELANYI"; + email = mkMailAddress "bruno" "belanyi.fr"; + }; + + aliases = { + jj = [ "util" "exec" "--" "jj" ]; + lol = [ "log" "-r" "..@" "-T" "builtin_log_oneline" ]; + lola = [ "lol" "-r" "all()" ]; + }; + + "--scope" = [ + # Multiple identities + { + "--when" = { + repositories = [ "~/git/EPITA/" ]; + }; + user = { + name = "Bruno BELANYI"; + email = mkMailAddress "bruno.belanyi" "epita.fr"; + }; + } + { + "--when" = { + repositories = [ "~/git/work/" ]; + }; + user = { + name = "Bruno BELANYI"; + email = mkMailAddress "ambroisie" "google.com"; + }; + } + ]; + }; + }; + }; +} From 226de511ae052335cc06bfd1baa508485322baa7 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 26 Feb 2025 10:51:31 +0000 Subject: [PATCH 10/20] home: delta: add 'jujutsu.enable' --- modules/home/delta/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/home/delta/default.nix b/modules/home/delta/default.nix index e76edc60..f6526321 100644 --- a/modules/home/delta/default.nix +++ b/modules/home/delta/default.nix @@ -11,6 +11,10 @@ in git = { enable = my.mkDisableOption "git integration"; }; + + jujutsu = { + enable = my.mkDisableOption "jujutsu integration"; + }; }; config = lib.mkIf cfg.enable { @@ -20,6 +24,9 @@ in inherit (cfg) package; enableGitIntegration = cfg.git.enable; + # `jj log -p` does not use `delta` + # https://github.com/jj-vcs/jj/issues/4142 + enableJujutsuIntegration = cfg.jujutsu.enable; options = { features = "diff-highlight decorations"; From bfa5bba8b111deea0a036ec8f4a40c4202f24263 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 4 Dec 2025 13:55:01 +0000 Subject: [PATCH 11/20] home: jujutsu: set 'ui.diff-formatter' I *still* don't really like the built-in formatting, but it's more about its highlighting than its syntax. Given that I default to using `delta` anyways, it doesn't _really_ matter as I don't see the default output. --- modules/home/jujutsu/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/home/jujutsu/default.nix b/modules/home/jujutsu/default.nix index eaf56e9d..fd8f84c1 100644 --- a/modules/home/jujutsu/default.nix +++ b/modules/home/jujutsu/default.nix @@ -40,6 +40,11 @@ in lola = [ "lol" "-r" "all()" ]; }; + ui = { + # I don't like word-diff + diff-formatter = ":git"; + }; + "--scope" = [ # Multiple identities { From bfebe310ab2fb7ce7fee36c247b2c1e6b07e26f2 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 4 Dec 2025 12:48:58 +0000 Subject: [PATCH 12/20] home: jujutsu: set 'ui.pager' The v0.36 release stopped honoring `$PAGER`. So enforce it in the configuration (as I don't like their default pager settings). Ideally this would be `mkIf`ed behind `my.home.pager.enable`, however it looks like this does not work with the TOML type (does not seem to do any `mkMerge`-ish logic). --- modules/home/jujutsu/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/home/jujutsu/default.nix b/modules/home/jujutsu/default.nix index fd8f84c1..8d4141c8 100644 --- a/modules/home/jujutsu/default.nix +++ b/modules/home/jujutsu/default.nix @@ -43,6 +43,8 @@ in ui = { # I don't like word-diff diff-formatter = ":git"; + # Does not honor `$PAGER` (anymore) + pager = lib.mkDefault config.home.sessionVariables.PAGER; }; "--scope" = [ From 7df6bb5c366e7512980e24d865dd808df6afbf2d Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 17 Mar 2025 12:43:12 +0000 Subject: [PATCH 13/20] home: jj: use verbose draft commit messages --- modules/home/jujutsu/default.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/home/jujutsu/default.nix b/modules/home/jujutsu/default.nix index 8d4141c8..206cc2b9 100644 --- a/modules/home/jujutsu/default.nix +++ b/modules/home/jujutsu/default.nix @@ -47,6 +47,28 @@ in pager = lib.mkDefault config.home.sessionVariables.PAGER; }; + templates = { + # Equivalent to `commit.verbose = true` in Git + draft_commit_description = "commit_description_verbose(self)"; + }; + + template-aliases = { + "commit_description_verbose(commit)" = '' + concat( + commit_description(commit), + "JJ: ignore-rest\n", + diff.git(), + ) + ''; + "commit_description(commit)" = '' + concat( + commit.description(), "\n", + "JJ: This commit contains the following changes:\n", + indent("JJ: ", diff.stat(72)), + ) + ''; + }; + "--scope" = [ # Multiple identities { From 5825b26067414d234c148e6f956bc5132e7032e5 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 18 Mar 2025 14:59:23 +0000 Subject: [PATCH 14/20] home: jujutsu: explicitly create 'conf.d' This is to serve as a reminder of _how_ to add a local configuration file. --- modules/home/jujutsu/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/home/jujutsu/default.nix b/modules/home/jujutsu/default.nix index 206cc2b9..4112dc09 100644 --- a/modules/home/jujutsu/default.nix +++ b/modules/home/jujutsu/default.nix @@ -92,5 +92,10 @@ in ]; }; }; + + # To drop in a `local.toml` configuration, not-versioned + xdg.configFile = { + "jj/conf.d/.keep".text = ""; + }; }; } From 2f8221f7a8b98a3f8484b78c4ad53ff291ff4f8d Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 11 Jul 2025 10:49:29 +0000 Subject: [PATCH 15/20] home: jujutsu: simplify 'jj jj' alias --- modules/home/jujutsu/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home/jujutsu/default.nix b/modules/home/jujutsu/default.nix index 4112dc09..2eec27ea 100644 --- a/modules/home/jujutsu/default.nix +++ b/modules/home/jujutsu/default.nix @@ -35,7 +35,7 @@ in }; aliases = { - jj = [ "util" "exec" "--" "jj" ]; + jj = [ ]; lol = [ "log" "-r" "..@" "-T" "builtin_log_oneline" ]; lola = [ "lol" "-r" "all()" ]; }; From 73f43a390f34bf71f15995821b0e3e6fc82d6506 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 22 Aug 2025 11:32:57 +0000 Subject: [PATCH 16/20] homes: bazin: use system jujutsu They have a custom `jj` with Piper CitC integration. --- hosts/homes/ambroisie@bazin/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts/homes/ambroisie@bazin/default.nix b/hosts/homes/ambroisie@bazin/default.nix index 365b70df..9ef26427 100644 --- a/hosts/homes/ambroisie@bazin/default.nix +++ b/hosts/homes/ambroisie@bazin/default.nix @@ -22,6 +22,10 @@ package = pkgs.emptyDirectory; }; + jujutsu = { + package = pkgs.emptyDirectory; + }; + tmux = { # I use scripts that use the passthrough sequence often on this host enablePassthrough = true; From a813ca634c67d550deeb83a4335af4eaa9641c1b Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 22 Aug 2025 11:32:57 +0000 Subject: [PATCH 17/20] homes: mousqueton: use system jujutsu They have a custom `jj` with Piper CitC integration. --- hosts/homes/ambroisie@mousqueton/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts/homes/ambroisie@mousqueton/default.nix b/hosts/homes/ambroisie@mousqueton/default.nix index 13836189..1ffee2b0 100644 --- a/hosts/homes/ambroisie@mousqueton/default.nix +++ b/hosts/homes/ambroisie@mousqueton/default.nix @@ -25,6 +25,10 @@ package = pkgs.emptyDirectory; }; + jujutsu = { + package = pkgs.emptyDirectory; + }; + tmux = { # I use scripts that use the passthrough sequence often on this host enablePassthrough = true; From fa1b1f8586010b8c926929c4aa69ca6962daaef7 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 27 Oct 2025 12:34:07 +0000 Subject: [PATCH 18/20] home: jujutsu: set 'ui.diff-editor' Otherwise it keeps nagging me with a hint to set it. I'm not a big fan of this UI, I wish I add something closer to Git's patch interface. --- modules/home/jujutsu/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/home/jujutsu/default.nix b/modules/home/jujutsu/default.nix index 2eec27ea..d24b5ca9 100644 --- a/modules/home/jujutsu/default.nix +++ b/modules/home/jujutsu/default.nix @@ -41,6 +41,8 @@ in }; ui = { + # Stop nagging me about it, though I am not a fan of its UI. + diff-editor = ":builtin"; # I don't like word-diff diff-formatter = ":git"; # Does not honor `$PAGER` (anymore) From 77f9d5965b8c00be1f8a34f65e090f91b2f246d7 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 26 Nov 2025 11:13:10 +0000 Subject: [PATCH 19/20] home: jujutsu: set 'ui.merge-editor' Same reason as `ui.diff-editor`. --- modules/home/jujutsu/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/home/jujutsu/default.nix b/modules/home/jujutsu/default.nix index d24b5ca9..1472e3ba 100644 --- a/modules/home/jujutsu/default.nix +++ b/modules/home/jujutsu/default.nix @@ -45,6 +45,8 @@ in diff-editor = ":builtin"; # I don't like word-diff diff-formatter = ":git"; + # Stop nagging me about it, though I am not a fan of its UI. + merge-editor = ":builtin"; # Does not honor `$PAGER` (anymore) pager = lib.mkDefault config.home.sessionVariables.PAGER; }; From abadfa7dad293d13ff353d67bd4095f22a6644ec Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 26 Feb 2025 10:51:31 +0000 Subject: [PATCH 20/20] WIP: ADD NOTE FOR FUTURE SELF --- modules/home/jujutsu/default.nix | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/modules/home/jujutsu/default.nix b/modules/home/jujutsu/default.nix index 1472e3ba..3072af42 100644 --- a/modules/home/jujutsu/default.nix +++ b/modules/home/jujutsu/default.nix @@ -36,8 +36,16 @@ in aliases = { jj = [ ]; + # FIXME: + # * still not a big fan of the template lol = [ "log" "-r" "..@" "-T" "builtin_log_oneline" ]; lola = [ "lol" "-r" "all()" ]; + # FIXME: equivalent to `git switch -` + # See https://github.com/jj-vcs/jj/issues/2871 + # Might be broken recently https://discord.com/channels/968932220549103686/1380272574709366989/1380432041983606855 + # TODO: + # * `pick` (https://github.com/jj-vcs/jj/issues/5446): [ "util" "exec" "--" "bash" "-c" "jj log -p -r \"diff_contains($1)\"" "" ] + # * `root`: `jj workspace root` (barely necessary then) }; ui = { @@ -51,6 +59,31 @@ in pager = lib.mkDefault config.home.sessionVariables.PAGER; }; + # FIXME: git equivalents + # I'd like a better formatted blame (more like delta's?) + # blame = { + # coloring = "repeatedLines"; + # markIgnoredLines = true; + # markUnblamables = true; + # }; + # FIXME: log colors should probably match git + # FIXME: patience diff? + # FIXME: fetch prune/pruneTags? + # FIXME: pull.rebase=true? Probably true TBH + # FIXME: push.default=simple? Probably true TBH + # FIXME: conflict style? ui.conflict-marker-style=git is diff3, not zdiff3. Default looks fine-ish + + # FIXME: from ma_9's config, plus my own stuff + # snapshot = { + # auto-track = "none()"; + # }; + # + # ui = { + # movement = { + # edit = false; + # }; + # }; + templates = { # Equivalent to `commit.verbose = true` in Git draft_commit_description = "commit_description_verbose(self)"; @@ -64,6 +97,9 @@ in diff.git(), ) ''; + # FIXME: use `diff.summary()` instead? Supported by syntax highlighting + # See https://github.com/jj-vcs/jj/issues/1946#issuecomment-2572986485 + # FIXME: tree-sitter grammar isn't in `nvim-treesitter` (https://github.com/kareigu/tree-sitter-jjdescription) "commit_description(commit)" = '' concat( commit.description(), "\n",