Compare commits

...

10 commits

Author SHA1 Message Date
410effd33a WIP: ADD NOTE FOR FUTURE SELF
Some checks failed
ci/woodpecker/push/check Pipeline failed
2025-10-20 15:09:00 +00:00
41bf5a48a2 homes: bazin: use system jujutsu
They have a custom `jj` with Piper CitC integration.
2025-10-20 15:08:45 +00:00
42033d52bb home: jujutsu: simplify 'jj jj' alias 2025-10-20 15:08:45 +00:00
87cc82effb home: jujutsu: explicitly create 'conf.d'
This is to serve as a reminder of _how_ to add a local configuration
file.
2025-10-20 15:08:45 +00:00
f6d236eafc home: jj: use verbose draft commit messages 2025-10-20 15:08:45 +00:00
667e2da6e1 home: delta: add 'jujutsu.enable' 2025-10-20 15:08:45 +00:00
90b73ebe79 home: add jujutsu
This is a very basic configuration, still missing most bells and
whistles.
2025-10-20 15:08:45 +00:00
0aee5e5da2 home: delta: use upstream module
Some checks failed
ci/woodpecker/push/check Pipeline failed
2025-10-20 15:08:45 +00:00
9421d79dc0 home: git: fix deprecated config 2025-10-20 15:08:45 +00:00
344c9b1a54 flake: bump inputs 2025-10-20 15:08:45 +00:00
6 changed files with 202 additions and 69 deletions

36
flake.lock generated
View file

@ -14,11 +14,11 @@
]
},
"locked": {
"lastModified": 1754433428,
"narHash": "sha256-NA/FT2hVhKDftbHSwVnoRTFhes62+7dxZbxj5Gxvghs=",
"lastModified": 1760836749,
"narHash": "sha256-wyT7Pl6tMFbFrs8Lk/TlEs81N6L+VSybPfiIgzU8lbQ=",
"owner": "ryantm",
"repo": "agenix",
"rev": "9edb1787864c4f59ae5074ad498b6272b3ec308d",
"rev": "2f0f812f69f3eb4140157fe15e12739adf82e32a",
"type": "github"
},
"original": {
@ -73,11 +73,11 @@
]
},
"locked": {
"lastModified": 1759362264,
"narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=",
"lastModified": 1760948891,
"narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "758cf7296bee11f1706a574c77d072b8a7baa881",
"rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04",
"type": "github"
},
"original": {
@ -117,11 +117,11 @@
]
},
"locked": {
"lastModified": 1758108966,
"narHash": "sha256-ytw7ROXaWZ7OfwHrQ9xvjpUWeGVm86pwnEd1QhzawIo=",
"lastModified": 1760663237,
"narHash": "sha256-BflA6U4AM1bzuRMR8QqzPXqh8sWVCNDzOdsxXEguJIc=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "54df955a695a84cd47d4a43e08e1feaf90b1fd9b",
"rev": "ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37",
"type": "github"
},
"original": {
@ -159,11 +159,11 @@
]
},
"locked": {
"lastModified": 1759337100,
"narHash": "sha256-CcT3QvZ74NGfM+lSOILcCEeU+SnqXRvl1XCRHenZ0Us=",
"lastModified": 1760969583,
"narHash": "sha256-vsf5mvR0xxK4GsfLx5bMJAQ4ysdrKymMIifNw+4TP7g=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "004753ae6b04c4b18aa07192c1106800aaacf6c3",
"rev": "c9d758b500e53db5b74aa02d17dc45b65229e8e9",
"type": "github"
},
"original": {
@ -175,11 +175,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1759422813,
"narHash": "sha256-WNkZqscW/dPLK5NMKH/jCkYMaVm/3KWgPmKMq65IXxk=",
"lastModified": 1760878510,
"narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2a7c84e1e740f004e0fe5c2577a63d1e659a496c",
"rev": "5e2a59a5b1a82f89f2c7e598302a9cacebb72a67",
"type": "github"
},
"original": {
@ -200,11 +200,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1753980880,
"narHash": "sha256-aj1pbYxL6N+XFqBHjB4B1QP0bnKRcg1AfpgT5zUFsW8=",
"lastModified": 1759781536,
"narHash": "sha256-v/X5gKmgVoGtu5elYyUu2w037PyWVhrqnWzXkLJ9xnY=",
"owner": "nix-community",
"repo": "NUR",
"rev": "16db3e61da7606984a05b4dfc33cd1d26d22fb22",
"rev": "c30a53a5947bcc874b3f8842e6fe5c34bc81d8dd",
"type": "github"
},
"original": {

View file

@ -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;

View file

@ -24,6 +24,7 @@
./gtk
./htop
./jq
./jujutsu
./keyboard
./mail
./mpv

View file

@ -1,9 +1,6 @@
{ config, pkgs, lib, ... }:
let
cfg = config.my.home.delta;
configFormat = pkgs.formats.gitIni { };
configPath = "${config.xdg.configHome}/delta/config";
in
{
options.my.home.delta = with lib; {
@ -14,31 +11,21 @@ in
git = {
enable = my.mkDisableOption "git integration";
};
jujutsu = {
enable = my.mkDisableOption "jujutsu integration";
};
};
config = lib.mkIf cfg.enable {
assertions = [
{
# For its configuration
assertion = cfg.enable -> cfg.git.enable;
message = ''
`config.my.home.delta` must enable `config.my.home.delta.git` to be
properly configured.
'';
}
{
assertion = cfg.enable -> config.programs.git.enable;
message = ''
`config.my.home.delta` relies on `config.programs.git` to be
enabled.
'';
}
];
programs.delta = {
enable = true;
home.packages = [ cfg.package ];
inherit (cfg) package;
xdg.configFile."delta/config".source = configFormat.generate "delta-config" {
delta = {
enableGitIntegration = cfg.git.enable;
options = {
features = "diff-highlight decorations";
# Less jarring style for `diff-highlight` emulation
@ -63,17 +50,25 @@ in
};
};
programs.git = lib.mkIf cfg.git.enable {
delta = {
enable = true;
inherit (cfg) package;
};
# `jj log -p` does not use `delta`
# https://github.com/jj-vcs/jj/issues/4142
programs.jujutsu = lib.mkIf cfg.jujutsu.enable {
settings = {
merge-tools = {
delta = {
# Errors are signaled with exit codes greater or equal to 2
diff-expected-exit-codes = [ 0 1 ];
};
};
includes = [
{
path = configPath;
}
];
ui = {
# Delta expects a `git diff` input
diff-formatter = ":git";
# `finalPackage` automatically applied `--config` if necessary
pager = [ (lib.getExe config.programs.delta.finalPackage) ];
};
};
};
};
}

View file

@ -21,29 +21,31 @@ in
config.programs.git = lib.mkIf cfg.enable {
enable = true;
# Who am I?
userEmail = mkMailAddress "bruno" "belanyi.fr";
userName = "Bruno BELANYI";
inherit (cfg) package;
aliases = {
git = "!git";
lol = "log --graph --decorate --pretty=oneline --abbrev-commit --topo-order";
lola = "lol --all";
assume = "update-index --assume-unchanged";
unassume = "update-index --no-assume-unchanged";
assumed = "!git ls-files -v | grep ^h | cut -c 3-";
pick = "log -p -G";
push-new = "!git push -u origin "
+ ''"$(git branch | grep '^* ' | cut -f2- -d' ')"'';
root = "git rev-parse --show-toplevel";
};
lfs.enable = true;
# There's more
extraConfig = {
settings = {
# Who am I?
user = {
email = mkMailAddress "bruno" "belanyi.fr";
name = "Bruno BELANYI";
};
alias = {
git = "!git";
lol = "log --graph --decorate --pretty=oneline --abbrev-commit --topo-order";
lola = "lol --all";
assume = "update-index --assume-unchanged";
unassume = "update-index --no-assume-unchanged";
assumed = "!git ls-files -v | grep ^h | cut -c 3-";
pick = "log -p -G";
push-new = "!git push -u origin "
+ ''"$(git branch | grep '^* ' | cut -f2- -d' ')"'';
root = "git rev-parse --show-toplevel";
};
# Makes it a bit more readable
blame = {
coloring = "repeatedLines";

View file

@ -0,0 +1,131 @@
{ 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 = [ ];
# 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)
};
# 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 = {
# diff-editor = ":builtin"; # To silence hints
# movement = {
# edit = false;
# };
# };
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(),
)
'';
# 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",
"JJ: This commit contains the following changes:\n",
indent("JJ: ", diff.stat(72)),
)
'';
};
"--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";
};
}
];
};
};
# To drop in a `local.toml` configuration, not-versioned
xdg.configFile = {
"jj/conf.d/.keep".text = "";
};
};
}