Compare commits

...

3 commits

Author SHA1 Message Date
d8cdd7a912
acme: append extra config 2025-05-22 21:51:08 +02:00
b4e456e3ac
postgresql: comment changes 2025-05-22 20:01:36 +02:00
bd98c92daf
jj: init 2025-05-22 20:01:08 +02:00
3 changed files with 111 additions and 2 deletions

View file

@ -0,0 +1,102 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.meta) getExe;
toml = pkgs.formats.toml {};
jj-config = toml.generate "config.toml" {
user = {
name = "Bloxx12";
email = "charlie@charlieroot.dev";
};
ui = {
pager = ["${getExe pkgs.bat}" "--plain"];
default-command = "log";
movement.edit = true;
diff.tool = ["${getExe pkgs.difft}" "--color" "always" "$left" "$right"];
};
# FIXME: do this with agenix
# "--scope" = [
# {
# "--when.repositories" = ["~/repos/projects/uni"];
# user = {
# # TODO
# name = "";
# email = "";
# };
# }
# {
# "--when.repositories" = ["~/repos/projects/uni/"];
# user = {
# # TODO
# name = "";
# email = "";
# };
# }
# ];
git.push-new-bookmarks = true;
signing = {
behaviour = "own";
backend = "ssh";
key = ["ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw=="];
};
aliases = {
c = ["commit"];
ci = ["commit" "--interactive"];
e = ["edit"];
# "new bookmark"
nb = ["bookmark" "create" "-r @-"];
pull = ["git" "fetch"];
push = ["git" "push" "--allow-new"];
r = ["rebase"];
s = ["squash"];
si = ["squash" "--interactive"];
tug = ["bookmark" "move" "--from" "closest_bookmark(@-)" "--to" "@-"];
};
revset-aliases = {
"closest_bookmark(to)" = "heads(::to & bookmarks())";
};
templates = {
draft_commit_description = ''
concat(
coalesce(description, "\n"),
surround(
"\nJJ: This commit contains the following changes:\n", "",
indent("JJ: ", diff.stat(72)),
),
"\nJJ: ignore-rest\n",
diff.git(),
)
'';
};
template-aliases = {
"format_short_id(id)" = "id.shortest()";
};
};
jj-wrapped = pkgs.symlinkJoin {
name = "jj-wrapped";
paths = [pkgs.jj];
nativeBuildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/mako --add-flags "\
--config ${jj-config}
'';
};
in {
environment.systemPackages = [jj-wrapped];
}

View file

@ -12,7 +12,7 @@
# email to send updates to, we prefix "acme" and the # email to send updates to, we prefix "acme" and the
# name of the domain the certificate is for to it. # name of the domain the certificate is for to it.
email = "acme+${domain}+charlie@charlieroot.dev"; email = "charlie@charlieroot.dev";
group = "nginx"; group = "nginx";
}; };
in { in {
@ -30,4 +30,11 @@ in {
"mail.charlieroot.dev" = mkAcmeCert "mail.charlieroot.dev"; "mail.charlieroot.dev" = mkAcmeCert "mail.charlieroot.dev";
}; };
}; };
services.nginx.appendConfig = ''
location /.well-known/acme-challenge/ {
rewrite /.well-known/acme-challenge/(.*) /$1 break;
root /var/lib/acme/.well-known/acme-challenge;
}
'';
} }

View file

@ -15,7 +15,7 @@ in {
services.postgresql = { services.postgresql = {
enable = true; enable = true;
package = pkgs.postgresql_17; package = pkgs.postgresql_17;
# NOTE: it is imperative to create this when starting postgresql! # NOTE: it is imperative to create this manually when starting postgresql.
dataDir = "/srv/data/postgresql/${config.services.postgresql.package.psqlSchema}"; dataDir = "/srv/data/postgresql/${config.services.postgresql.package.psqlSchema}";
# Whether PostgreSQL should listen on all network interfaces. # Whether PostgreSQL should listen on all network interfaces.