Compare commits
No commits in common. "add-jj" and "main" have entirely different histories.
6 changed files with 7 additions and 214 deletions
|
|
@ -22,10 +22,6 @@
|
||||||
package = pkgs.emptyDirectory;
|
package = pkgs.emptyDirectory;
|
||||||
};
|
};
|
||||||
|
|
||||||
jujutsu = {
|
|
||||||
package = pkgs.emptyDirectory;
|
|
||||||
};
|
|
||||||
|
|
||||||
tmux = {
|
tmux = {
|
||||||
# I use scripts that use the passthrough sequence often on this host
|
# I use scripts that use the passthrough sequence often on this host
|
||||||
enablePassthrough = true;
|
enablePassthrough = true;
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,6 @@
|
||||||
package = pkgs.emptyDirectory;
|
package = pkgs.emptyDirectory;
|
||||||
};
|
};
|
||||||
|
|
||||||
jujutsu = {
|
|
||||||
package = pkgs.emptyDirectory;
|
|
||||||
};
|
|
||||||
|
|
||||||
tmux = {
|
tmux = {
|
||||||
# I use scripts that use the passthrough sequence often on this host
|
# I use scripts that use the passthrough sequence often on this host
|
||||||
enablePassthrough = true;
|
enablePassthrough = true;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@
|
||||||
./gtk
|
./gtk
|
||||||
./htop
|
./htop
|
||||||
./jq
|
./jq
|
||||||
./jujutsu
|
|
||||||
./keyboard
|
./keyboard
|
||||||
./mail
|
./mail
|
||||||
./mpv
|
./mpv
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,6 @@ in
|
||||||
git = {
|
git = {
|
||||||
enable = my.mkDisableOption "git integration";
|
enable = my.mkDisableOption "git integration";
|
||||||
};
|
};
|
||||||
|
|
||||||
jujutsu = {
|
|
||||||
enable = my.mkDisableOption "jujutsu integration";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
@ -24,9 +20,6 @@ in
|
||||||
inherit (cfg) package;
|
inherit (cfg) package;
|
||||||
|
|
||||||
enableGitIntegration = cfg.git.enable;
|
enableGitIntegration = cfg.git.enable;
|
||||||
# `jj log -p` does not use `delta`
|
|
||||||
# https://github.com/jj-vcs/jj/issues/4142
|
|
||||||
enableJujutsuIntegration = cfg.jujutsu.enable;
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
features = "diff-highlight decorations";
|
features = "diff-highlight decorations";
|
||||||
|
|
|
||||||
|
|
@ -1,141 +0,0 @@
|
||||||
{ 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)
|
|
||||||
};
|
|
||||||
|
|
||||||
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";
|
|
||||||
# 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;
|
|
||||||
};
|
|
||||||
|
|
||||||
# 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)";
|
|
||||||
};
|
|
||||||
|
|
||||||
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 = "";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -24,15 +24,11 @@ current_system() {
|
||||||
nix eval --raw --impure --expr 'builtins.currentSystem'
|
nix eval --raw --impure --expr 'builtins.currentSystem'
|
||||||
}
|
}
|
||||||
|
|
||||||
add_darwin() {
|
|
||||||
FLAKE_OUTPUTS+=("darwinConfigurations.\"$1\".config.system.build.toplevel")
|
|
||||||
}
|
|
||||||
|
|
||||||
add_home() {
|
add_home() {
|
||||||
FLAKE_OUTPUTS+=("homeConfigurations.\"$1\".activationPackage")
|
FLAKE_OUTPUTS+=("homeConfigurations.\"$1\".activationPackage")
|
||||||
}
|
}
|
||||||
|
|
||||||
add_nixos() {
|
add_host() {
|
||||||
FLAKE_OUTPUTS+=("nixosConfigurations.\"$1\".config.system.build.toplevel")
|
FLAKE_OUTPUTS+=("nixosConfigurations.\"$1\".config.system.build.toplevel")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,10 +37,6 @@ add_shell() {
|
||||||
FLAKE_OUTPUTS+=("devShells.\"$(current_system)\".\"$1\".inputDerivation")
|
FLAKE_OUTPUTS+=("devShells.\"$(current_system)\".\"$1\".inputDerivation")
|
||||||
}
|
}
|
||||||
|
|
||||||
add_system() {
|
|
||||||
FLAKE_OUTPUTS+=("systemConfigs.\"$1\".config.system.build.toplevel")
|
|
||||||
}
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
print_err "Usage: $0 [option]... [-- [nix build option]...]"
|
print_err "Usage: $0 [option]... [-- [nix build option]...]"
|
||||||
print_err ""
|
print_err ""
|
||||||
|
|
@ -62,15 +54,11 @@ usage() {
|
||||||
print_err " -p, --previous-rev"
|
print_err " -p, --previous-rev"
|
||||||
print_err " which git revision should be considered the 'previous' state,"
|
print_err " which git revision should be considered the 'previous' state,"
|
||||||
print_err " defaults to HEAD~"
|
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 " --home [name]"
|
||||||
print_err " specify the name of a home-manager output configuration whose"
|
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 " closure should be diffed, can be used multiple times"
|
||||||
print_err " if no configuration name is given, defaults to current username"
|
print_err " if no configuration name is given, defaults to current username"
|
||||||
print_err " --nixos [name]"
|
print_err " --host [name]"
|
||||||
print_err " specify the name of a NixOS output configuration whose"
|
print_err " specify the name of a NixOS output configuration whose"
|
||||||
print_err " closure should be diffed, can be used multiple times"
|
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 " if no host name is given, defaults to current hostname"
|
||||||
|
|
@ -78,10 +66,6 @@ usage() {
|
||||||
print_err " specify a specific devShell configuration name whose closure"
|
print_err " specify a specific devShell configuration name whose closure"
|
||||||
print_err " should be diffed, can be used multiple times"
|
print_err " should be diffed, can be used multiple times"
|
||||||
print_err " if no name is given, defaults to 'default'"
|
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 ""
|
||||||
print_err "when no flake outputs are specified, automatically queries for"
|
print_err "when no flake outputs are specified, automatically queries for"
|
||||||
print_err "all NixOS configurations, and devShells for current system"
|
print_err "all NixOS configurations, and devShells for current system"
|
||||||
|
|
@ -117,14 +101,6 @@ parse_args() {
|
||||||
PREVIOUS_REV="$(git rev-parse "$1")"
|
PREVIOUS_REV="$(git rev-parse "$1")"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--darwin)
|
|
||||||
if [ $# -gt 0 ] && ! is_option "$1"; then
|
|
||||||
add_darwin "$1"
|
|
||||||
shift
|
|
||||||
else
|
|
||||||
add_darwin "$(hostname)"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
--home)
|
--home)
|
||||||
if [ $# -gt 0 ] && ! is_option "$1"; then
|
if [ $# -gt 0 ] && ! is_option "$1"; then
|
||||||
add_home "$1"
|
add_home "$1"
|
||||||
|
|
@ -133,12 +109,12 @@ parse_args() {
|
||||||
add_home "$USER"
|
add_home "$USER"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
--nixos)
|
--host)
|
||||||
if [ $# -gt 0 ] && ! is_option "$1"; then
|
if [ $# -gt 0 ] && ! is_option "$1"; then
|
||||||
add_nixos "$1"
|
add_host "$1"
|
||||||
shift
|
shift
|
||||||
else
|
else
|
||||||
add_nixos "$(hostname)"
|
add_host "$(hostname)"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
--shell)
|
--shell)
|
||||||
|
|
@ -149,14 +125,6 @@ parse_args() {
|
||||||
add_shell "default"
|
add_shell "default"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
--system)
|
|
||||||
if [ $# -gt 0 ] && ! is_option "$1"; then
|
|
||||||
add_system "$1"
|
|
||||||
shift
|
|
||||||
else
|
|
||||||
add_system "$(hostname)"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
--)
|
--)
|
||||||
NIX_BUILD_ARGS=("$@")
|
NIX_BUILD_ARGS=("$@")
|
||||||
break
|
break
|
||||||
|
|
@ -170,12 +138,6 @@ parse_args() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
list_darwin_configurations() {
|
|
||||||
nix eval '.#darwinConfigurations' \
|
|
||||||
--apply 'attrs: with builtins; concatStringsSep "\n" (attrNames attrs)' \
|
|
||||||
--raw
|
|
||||||
}
|
|
||||||
|
|
||||||
list_home_configurations() {
|
list_home_configurations() {
|
||||||
nix eval '.#homeConfigurations' \
|
nix eval '.#homeConfigurations' \
|
||||||
--apply 'attrs: with builtins; concatStringsSep "\n" (attrNames attrs)' \
|
--apply 'attrs: with builtins; concatStringsSep "\n" (attrNames attrs)' \
|
||||||
|
|
@ -194,12 +156,6 @@ list_dev_shells() {
|
||||||
--raw
|
--raw
|
||||||
}
|
}
|
||||||
|
|
||||||
list_system_configurations() {
|
|
||||||
nix eval '.#systemConfigs' \
|
|
||||||
--apply 'attrs: with builtins; concatStringsSep "\n" (attrNames attrs)' \
|
|
||||||
--raw
|
|
||||||
}
|
|
||||||
|
|
||||||
diff_output() {
|
diff_output() {
|
||||||
local PREV NEW
|
local PREV NEW
|
||||||
PREV="$(mktemp --dry-run)"
|
PREV="$(mktemp --dry-run)"
|
||||||
|
|
@ -219,21 +175,15 @@ diff_output() {
|
||||||
parse_args "$@"
|
parse_args "$@"
|
||||||
|
|
||||||
if [ "${#FLAKE_OUTPUTS[@]}" -eq 0 ]; then
|
if [ "${#FLAKE_OUTPUTS[@]}" -eq 0 ]; then
|
||||||
for darwin in $(list_darwin_configurations); do
|
|
||||||
add_darwin "$darwin"
|
|
||||||
done
|
|
||||||
for home in $(list_home_configurations); do
|
for home in $(list_home_configurations); do
|
||||||
add_home "$home"
|
add_home "$home"
|
||||||
done
|
done
|
||||||
for nixos in $(list_nixos_configurations); do
|
for host in $(list_nixos_configurations); do
|
||||||
add_nixos "$nixos"
|
add_host "$host"
|
||||||
done
|
done
|
||||||
for shell in $(list_dev_shells); do
|
for shell in $(list_dev_shells); do
|
||||||
add_shell "$shell"
|
add_shell "$shell"
|
||||||
done
|
done
|
||||||
for system in $(list_system_configurations); do
|
|
||||||
add_system "$system"
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for out in "${FLAKE_OUTPUTS[@]}"; do
|
for out in "${FLAKE_OUTPUTS[@]}"; do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue