Compare commits

...

13 commits

Author SHA1 Message Date
b41f560fa3 home: jujutsu: simplify 'jj jj' alias
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2025-07-11 10:49:29 +00:00
98999f3199 home: jujutsu: explicitly create 'conf.d'
This is to serve as a reminder of _how_ to add a local configuration
file.
2025-07-11 10:48:49 +00:00
9f437f9291 WIP: ADD NOTE FOR FUTURE SELF 2025-07-11 10:48:49 +00:00
5e4f4457f0 home: jj: use verbose draft commit messages 2025-07-11 10:48:49 +00:00
01116d9480 WIP: add jujutsu (w/ Delta) 2025-07-11 10:48:49 +00:00
b093faf00d nixos: services: tandoor-recipes: use automatic DB
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2025-07-08 10:42:13 +00:00
8d809e3ac3 flake: bump inputs 2025-07-08 10:40:08 +00:00
66ec807dc6 hosts: nixos: aramis: home: use 'trgui-ng'
All checks were successful
ci/woodpecker/push/check Pipeline was successful
It looks and works much better than the old one.

Unfortunately, it's a Tauri app.
2025-07-02 14:01:18 +02:00
5d87223970 nixos: services: transmission: use 'trgui-ng'
All checks were successful
ci/woodpecker/push/check Pipeline was successful
I like it much better than the built-in UI.
2025-07-02 13:26:22 +02:00
d618406516 nixos: services: use 'postgresql.target'
This is now the more correct dependency to use in service definitions,
to guarantee read-write access with users and permissions.
2025-07-02 13:24:19 +02:00
03bb627770 flake: bump inputs 2025-07-02 13:23:34 +02:00
112e340361 home: do not hard-code username
All checks were successful
ci/woodpecker/push/check Pipeline was successful
The flake module already sets it with `mkDefault`, making it easier to
override it for a specific host.
2025-06-17 09:29:30 +00:00
1b275e1a8a flake: bump inputs 2025-06-17 09:29:30 +00:00
9 changed files with 186 additions and 44 deletions

30
flake.lock generated
View file

@ -14,11 +14,11 @@
]
},
"locked": {
"lastModified": 1747575206,
"narHash": "sha256-NwmAFuDUO/PFcgaGGr4j3ozG9Pe5hZ/ogitWhY+D81k=",
"lastModified": 1750173260,
"narHash": "sha256-9P1FziAwl5+3edkfFcr5HeGtQUtrSdk/MksX39GieoA=",
"owner": "ryantm",
"repo": "agenix",
"rev": "4835b1dc898959d8547a871ef484930675cb47f1",
"rev": "531beac616433bac6f9e2a19feb8e99a22a66baf",
"type": "github"
},
"original": {
@ -73,11 +73,11 @@
]
},
"locked": {
"lastModified": 1749398372,
"narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=",
"lastModified": 1751413152,
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569",
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
"type": "github"
},
"original": {
@ -117,11 +117,11 @@
]
},
"locked": {
"lastModified": 1747372754,
"narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=",
"lastModified": 1750779888,
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46",
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
"type": "github"
},
"original": {
@ -159,11 +159,11 @@
]
},
"locked": {
"lastModified": 1749400020,
"narHash": "sha256-0nTmHO8AYgRYk5v6zw5oZ3x9nh+feb+Isn7WNe318M0=",
"lastModified": 1751429452,
"narHash": "sha256-4s5vRtaqdNhVBnbOWOzBNKrRa0ShQTLoEPjJp3joeNI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2835e8ba0ad99ba86d4a5e497a962ec9fa35e48f",
"rev": "df12269039dcf752600b1bcc176bacf2786ec384",
"type": "github"
},
"original": {
@ -175,11 +175,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1749285348,
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
"lastModified": 1751952840,
"narHash": "sha256-SIkjQb9PPGvR/EcZAU8UZEnO9dwY2Z/BrDWgtyZd7OA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3e3afe5174c561dee0df6f2c2b2236990146329f",
"rev": "27278798fe68d7f81131dd7ab62b8ea2b795cd56",
"type": "github"
},
"original": {

View file

@ -20,7 +20,7 @@
element-desktop # Matrix client
jellyfin-media-player # Wraps the webui and mpv together
pavucontrol # Audio mixer GUI
transgui # Transmission remote
trgui-ng # Transmission remote
];
# Minimal video player
mpv.enable = true;

View file

@ -24,6 +24,7 @@
./gtk
./htop
./jq
./jujutsu
./keyboard
./mail
./mpv
@ -51,9 +52,6 @@
# First sane reproducible version
home.stateVersion = "20.09";
# Who am I?
home.username = "ambroisie";
# Start services automatically
systemd.user.startServices = "sd-switch";
}

View file

@ -11,6 +11,10 @@ in
git = {
enable = my.mkDisableOption "git integration";
};
jujutsu = {
enable = my.mkDisableOption "jujutsu integration";
};
};
config = lib.mkIf cfg.enable {
@ -30,6 +34,13 @@ in
enabled.
'';
}
{
assertion = cfg.jujutsu.enable -> cfg.git.enable;
message = ''
`config.my.home.delta.jujutsu` relies on `config.my.home.delta.git`
being enabled.
'';
}
];
home.packages = [ cfg.package ];
@ -64,5 +75,23 @@ in
};
};
};
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 ];
};
};
ui = {
# Delta expects a `git diff` input
diff-formatter = ":git";
pager = "${lib.getExe cfg.package}";
};
};
};
};
}

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:
# * topo sort by default (I think? test it)
# * 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
# 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/zdiff3
# 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 = "";
};
};
}

View file

@ -6,8 +6,8 @@ in
config = lib.mkIf cfg.enable {
systemd.services.drone-server = {
wantedBy = [ "multi-user.target" ];
after = [ "postgresql.service" ];
requires = [ "postgresql.service" ];
after = [ "postgresql.target" ];
requires = [ "postgresql.target" ];
serviceConfig = {
EnvironmentFile = [
cfg.secretFile

View file

@ -26,18 +26,16 @@ in
services.tandoor-recipes = {
enable = true;
database = {
createLocally = true;
};
port = cfg.port;
extraConfig =
let
tandoorRecipesDomain = "recipes.${config.networking.domain}";
in
{
# Use PostgreSQL
DB_ENGINE = "django.db.backends.postgresql";
POSTGRES_HOST = "/run/postgresql";
POSTGRES_USER = "tandoor_recipes";
POSTGRES_DB = "tandoor_recipes";
# Security settings
ALLOWED_HOSTS = tandoorRecipesDomain;
CSRF_TRUSTED_ORIGINS = "https://${tandoorRecipesDomain}";
@ -49,27 +47,12 @@ in
systemd.services = {
tandoor-recipes = {
after = [ "postgresql.service" ];
requires = [ "postgresql.service" ];
serviceConfig = {
EnvironmentFile = cfg.secretKeyFile;
};
};
};
# Set-up database
services.postgresql = {
enable = true;
ensureDatabases = [ "tandoor_recipes" ];
ensureUsers = [
{
name = "tandoor_recipes";
ensureDBOwnership = true;
}
];
};
my.services.nginx.virtualHosts = {
recipes = {
inherit (cfg) port;

View file

@ -47,6 +47,7 @@ in
enable = true;
package = pkgs.transmission_4;
group = "media";
webHome = pkgs.trgui-ng-web;
downloadDirPermissions = "775";

View file

@ -24,8 +24,8 @@ in
};
systemd.services.woodpecker-server = {
after = [ "postgresql.service" ];
requires = [ "postgresql.service" ];
after = [ "postgresql.target" ];
requires = [ "postgresql.target" ];
serviceConfig = {
# Set username for DB access