Compare commits
13 commits
f761f11b6c
...
b41f560fa3
| Author | SHA1 | Date | |
|---|---|---|---|
| b41f560fa3 | |||
| 98999f3199 | |||
| 9f437f9291 | |||
| 5e4f4457f0 | |||
| 01116d9480 | |||
| b093faf00d | |||
| 8d809e3ac3 | |||
| 66ec807dc6 | |||
| 5d87223970 | |||
| d618406516 | |||
| 03bb627770 | |||
| 112e340361 | |||
| 1b275e1a8a |
9 changed files with 186 additions and 44 deletions
30
flake.lock
generated
30
flake.lock
generated
|
|
@ -14,11 +14,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1747575206,
|
"lastModified": 1750173260,
|
||||||
"narHash": "sha256-NwmAFuDUO/PFcgaGGr4j3ozG9Pe5hZ/ogitWhY+D81k=",
|
"narHash": "sha256-9P1FziAwl5+3edkfFcr5HeGtQUtrSdk/MksX39GieoA=",
|
||||||
"owner": "ryantm",
|
"owner": "ryantm",
|
||||||
"repo": "agenix",
|
"repo": "agenix",
|
||||||
"rev": "4835b1dc898959d8547a871ef484930675cb47f1",
|
"rev": "531beac616433bac6f9e2a19feb8e99a22a66baf",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -73,11 +73,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1749398372,
|
"lastModified": 1751413152,
|
||||||
"narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=",
|
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569",
|
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -117,11 +117,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1747372754,
|
"lastModified": 1750779888,
|
||||||
"narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=",
|
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46",
|
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -159,11 +159,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1749400020,
|
"lastModified": 1751429452,
|
||||||
"narHash": "sha256-0nTmHO8AYgRYk5v6zw5oZ3x9nh+feb+Isn7WNe318M0=",
|
"narHash": "sha256-4s5vRtaqdNhVBnbOWOzBNKrRa0ShQTLoEPjJp3joeNI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "2835e8ba0ad99ba86d4a5e497a962ec9fa35e48f",
|
"rev": "df12269039dcf752600b1bcc176bacf2786ec384",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -175,11 +175,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1749285348,
|
"lastModified": 1751952840,
|
||||||
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
|
"narHash": "sha256-SIkjQb9PPGvR/EcZAU8UZEnO9dwY2Z/BrDWgtyZd7OA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3e3afe5174c561dee0df6f2c2b2236990146329f",
|
"rev": "27278798fe68d7f81131dd7ab62b8ea2b795cd56",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
element-desktop # Matrix client
|
element-desktop # Matrix client
|
||||||
jellyfin-media-player # Wraps the webui and mpv together
|
jellyfin-media-player # Wraps the webui and mpv together
|
||||||
pavucontrol # Audio mixer GUI
|
pavucontrol # Audio mixer GUI
|
||||||
transgui # Transmission remote
|
trgui-ng # Transmission remote
|
||||||
];
|
];
|
||||||
# Minimal video player
|
# Minimal video player
|
||||||
mpv.enable = true;
|
mpv.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
./gtk
|
./gtk
|
||||||
./htop
|
./htop
|
||||||
./jq
|
./jq
|
||||||
|
./jujutsu
|
||||||
./keyboard
|
./keyboard
|
||||||
./mail
|
./mail
|
||||||
./mpv
|
./mpv
|
||||||
|
|
@ -51,9 +52,6 @@
|
||||||
# First sane reproducible version
|
# First sane reproducible version
|
||||||
home.stateVersion = "20.09";
|
home.stateVersion = "20.09";
|
||||||
|
|
||||||
# Who am I?
|
|
||||||
home.username = "ambroisie";
|
|
||||||
|
|
||||||
# Start services automatically
|
# Start services automatically
|
||||||
systemd.user.startServices = "sd-switch";
|
systemd.user.startServices = "sd-switch";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
@ -30,6 +34,13 @@ in
|
||||||
enabled.
|
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 ];
|
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}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
131
modules/home/jujutsu/default.nix
Normal file
131
modules/home/jujutsu/default.nix
Normal 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 = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -6,8 +6,8 @@ in
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
systemd.services.drone-server = {
|
systemd.services.drone-server = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "postgresql.service" ];
|
after = [ "postgresql.target" ];
|
||||||
requires = [ "postgresql.service" ];
|
requires = [ "postgresql.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
EnvironmentFile = [
|
EnvironmentFile = [
|
||||||
cfg.secretFile
|
cfg.secretFile
|
||||||
|
|
|
||||||
|
|
@ -26,18 +26,16 @@ in
|
||||||
services.tandoor-recipes = {
|
services.tandoor-recipes = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
database = {
|
||||||
|
createLocally = true;
|
||||||
|
};
|
||||||
|
|
||||||
port = cfg.port;
|
port = cfg.port;
|
||||||
extraConfig =
|
extraConfig =
|
||||||
let
|
let
|
||||||
tandoorRecipesDomain = "recipes.${config.networking.domain}";
|
tandoorRecipesDomain = "recipes.${config.networking.domain}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# Use PostgreSQL
|
|
||||||
DB_ENGINE = "django.db.backends.postgresql";
|
|
||||||
POSTGRES_HOST = "/run/postgresql";
|
|
||||||
POSTGRES_USER = "tandoor_recipes";
|
|
||||||
POSTGRES_DB = "tandoor_recipes";
|
|
||||||
|
|
||||||
# Security settings
|
# Security settings
|
||||||
ALLOWED_HOSTS = tandoorRecipesDomain;
|
ALLOWED_HOSTS = tandoorRecipesDomain;
|
||||||
CSRF_TRUSTED_ORIGINS = "https://${tandoorRecipesDomain}";
|
CSRF_TRUSTED_ORIGINS = "https://${tandoorRecipesDomain}";
|
||||||
|
|
@ -49,27 +47,12 @@ in
|
||||||
|
|
||||||
systemd.services = {
|
systemd.services = {
|
||||||
tandoor-recipes = {
|
tandoor-recipes = {
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
EnvironmentFile = cfg.secretKeyFile;
|
EnvironmentFile = cfg.secretKeyFile;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set-up database
|
|
||||||
services.postgresql = {
|
|
||||||
enable = true;
|
|
||||||
ensureDatabases = [ "tandoor_recipes" ];
|
|
||||||
ensureUsers = [
|
|
||||||
{
|
|
||||||
name = "tandoor_recipes";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
my.services.nginx.virtualHosts = {
|
my.services.nginx.virtualHosts = {
|
||||||
recipes = {
|
recipes = {
|
||||||
inherit (cfg) port;
|
inherit (cfg) port;
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.transmission_4;
|
package = pkgs.transmission_4;
|
||||||
group = "media";
|
group = "media";
|
||||||
|
webHome = pkgs.trgui-ng-web;
|
||||||
|
|
||||||
downloadDirPermissions = "775";
|
downloadDirPermissions = "775";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.woodpecker-server = {
|
systemd.services.woodpecker-server = {
|
||||||
after = [ "postgresql.service" ];
|
after = [ "postgresql.target" ];
|
||||||
requires = [ "postgresql.service" ];
|
requires = [ "postgresql.target" ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
# Set username for DB access
|
# Set username for DB access
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue