Compare commits

...

16 commits

Author SHA1 Message Date
ccf222eb9c WIP: ADD NOTE FOR FUTURE SELF
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2025-12-01 12:25:10 +00:00
a008c9b73b home: jujutsu: set 'ui.merge-editor'
Same reason as `ui.diff-editor`.
2025-12-01 12:25:10 +00:00
50f95ce1e1 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.
2025-12-01 12:25:10 +00:00
15687fc8b0 homes: mousqueton: use system jujutsu
They have a custom `jj` with Piper CitC integration.
2025-12-01 12:25:10 +00:00
2a7957efea homes: bazin: use system jujutsu
They have a custom `jj` with Piper CitC integration.
2025-12-01 12:25:10 +00:00
ae21b93424 home: jujutsu: simplify 'jj jj' alias 2025-12-01 12:25:10 +00:00
7a406520e1 home: jujutsu: explicitly create 'conf.d'
This is to serve as a reminder of _how_ to add a local configuration
file.
2025-12-01 12:25:10 +00:00
21a5705631 home: jj: use verbose draft commit messages 2025-12-01 12:25:10 +00:00
0ba3d37813 home: delta: add 'jujutsu.enable' 2025-12-01 12:25:10 +00:00
5d511a029c home: add jujutsu
This is a very basic configuration, still missing most bells and
whistles.
2025-12-01 12:25:09 +00:00
e72a8b3f0f pkgs: diff-flake: rename 'host' to 'nixos'
To avoid mixing them up with Nix-Darwin and System Manager hosts.
2025-12-01 12:22:09 +00:00
fae47faaff pkgs: diff-flake: add system-manager support 2025-12-01 12:22:09 +00:00
eb59aa14e8 pkgs: diff-flake: add nix-darwin support 2025-12-01 12:22:09 +00:00
5cd9155a58 nixos: services: mealie: backup state directory
All checks were successful
ci/woodpecker/push/check Pipeline was successful
Somehow forgot to do this when first writing the module.
2025-11-30 00:21:21 +01:00
f546f85037 hosts: nixos: porthos: secrets: sso: remove owner
Now that the service uses `LoadCredential` [1], I can make the files
root-owned.

[1]: https://github.com/NixOS/nixpkgs/pull/460305
2025-11-30 00:21:21 +01:00
3020c6433b flake: bump inputs 2025-11-30 00:21:21 +01:00
9 changed files with 237 additions and 37 deletions

36
flake.lock generated
View file

@ -53,11 +53,11 @@
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1747046372, "lastModified": 1761588595,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", "narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
"owner": "edolstra", "owner": "edolstra",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -73,11 +73,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1762980239, "lastModified": 1763759067,
"narHash": "sha256-8oNVE8TrD19ulHinjaqONf9QWCKK+w4url56cdStMpM=", "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "52a2caecc898d0b46b2b905f058ccc5081f842da", "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -117,11 +117,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763319842, "lastModified": 1763988335,
"narHash": "sha256-YG19IyrTdnVn0l3DvcUYm85u3PaqBt6tI6VvolcuHnA=", "narHash": "sha256-QlcnByMc8KBjpU37rbq5iP7Cp97HvjRP0ucfdh+M4Qc=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "7275fa67fbbb75891c16d9dee7d88e58aea2d761", "rev": "50b9238891e388c9fdc6a5c49e49c42533a1b5ce",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -159,11 +159,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763313531, "lastModified": 1764361670,
"narHash": "sha256-yvdCYUL85zEDp2NzPUBmaNBXP6KnWEOhAk3j7PTfsKw=", "narHash": "sha256-jgWzgpIaHbL3USIq0gihZeuy1lLf2YSfwvWEwnfAJUw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "3670a78eee49deebe4825fc8ecc46b172d1a8391", "rev": "780be8ef503a28939cf9dc7996b48ffb1a3e04c6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -175,11 +175,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1763283776, "lastModified": 1764242076,
"narHash": "sha256-Y7TDFPK4GlqrKrivOcsHG8xSGqQx3A6c+i7novT85Uk=", "narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "50a96edd8d0db6cc8db57dab6bb6d6ee1f3dc49a", "rev": "2fad6eac6077f03fe109c4d4eb171cf96791faa4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -199,11 +199,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763378400, "lastModified": 1764449851,
"narHash": "sha256-9eZj8GNTBYnI8PQf9n8m9XbFCA/ugQ5r7sylY9DEx9M=", "narHash": "sha256-VnodC1+3KML8MYLLnK84E6U2Fz4ioNacOeQd1pMCSTw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "6bd477535ba71aa22d2712c8735c92812a1c74dc", "rev": "b1781c0aa8935d8d1f35d228bcc7127fcebcd363",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -22,6 +22,10 @@
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;

View file

@ -25,6 +25,10 @@
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;

View file

@ -83,18 +83,9 @@ in
"servarr/autobrr/session-secret.age".publicKeys = all; "servarr/autobrr/session-secret.age".publicKeys = all;
"servarr/cross-seed/configuration.json.age".publicKeys = all; "servarr/cross-seed/configuration.json.age".publicKeys = all;
"sso/auth-key.age" = { "sso/auth-key.age".publicKeys = all;
owner = "nginx-sso"; "sso/ambroisie/password-hash.age".publicKeys = all;
publicKeys = all; "sso/ambroisie/totp-secret.age".publicKeys = all;
};
"sso/ambroisie/password-hash.age" = {
owner = "nginx-sso";
publicKeys = all;
};
"sso/ambroisie/totp-secret.age" = {
owner = "nginx-sso";
publicKeys = all;
};
"tandoor-recipes/secret-key.age".publicKeys = all; "tandoor-recipes/secret-key.age".publicKeys = all;

View file

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

View file

@ -11,6 +11,10 @@ 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 {
@ -20,6 +24,9 @@ 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";

View file

@ -0,0 +1,137 @@
{ 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";
# Stop nagging me about it, though I am not a fan of its UI.
merge-editor = ":builtin";
};
# 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 = "";
};
};
}

View file

@ -54,6 +54,12 @@ in
}; };
}; };
my.services.backup = {
paths = [
"/var/lib/mealie"
];
};
services.fail2ban.jails = { services.fail2ban.jails = {
mealie = '' mealie = ''
enabled = true enabled = true

View file

@ -24,11 +24,15 @@ 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_host() { add_nixos() {
FLAKE_OUTPUTS+=("nixosConfigurations.\"$1\".config.system.build.toplevel") FLAKE_OUTPUTS+=("nixosConfigurations.\"$1\".config.system.build.toplevel")
} }
@ -37,6 +41,10 @@ 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 ""
@ -54,11 +62,15 @@ 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 " --host [name]" print_err " --nixos [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"
@ -66,6 +78,10 @@ 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"
@ -101,6 +117,14 @@ 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"
@ -109,12 +133,12 @@ parse_args() {
add_home "$USER" add_home "$USER"
fi fi
;; ;;
--host) --nixos)
if [ $# -gt 0 ] && ! is_option "$1"; then if [ $# -gt 0 ] && ! is_option "$1"; then
add_host "$1" add_nixos "$1"
shift shift
else else
add_host "$(hostname)" add_nixos "$(hostname)"
fi fi
;; ;;
--shell) --shell)
@ -125,6 +149,14 @@ 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
@ -138,6 +170,12 @@ 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)' \
@ -156,6 +194,12 @@ 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)"
@ -175,15 +219,21 @@ 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 host in $(list_nixos_configurations); do for nixos in $(list_nixos_configurations); do
add_host "$host" add_nixos "$nixos"
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