Compare commits

...

7 Commits

3 changed files with 31 additions and 3 deletions

View File

@@ -1,10 +1,14 @@
{ {
config,
pkgs, pkgs,
inputs, inputs,
user, user,
hostname, hostname,
... ...
}: { }: let
himalaya = config.home-manager.users.${user}.programs.himalaya.package;
opencode = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.opencode;
in {
imports = [ imports = [
./adguardhome.nix ./adguardhome.nix
./cache.nix ./cache.nix
@@ -52,6 +56,30 @@
]; ];
programs.git.settings.user.email = "christoph@schmatzler.com"; programs.git.settings.user.email = "christoph@schmatzler.com";
systemd.user.services.opencode-inbox-triage = {
Unit = {
Description = "OpenCode inbox triage";
};
Service = {
Type = "oneshot";
ExecStart = "${opencode}/bin/opencode run --command inbox-triage";
Environment = "PATH=${himalaya}/bin:${opencode}/bin:${pkgs.coreutils}/bin";
};
};
systemd.user.timers.opencode-inbox-triage = {
Unit = {
Description = "Run OpenCode inbox triage every 10 minutes";
};
Timer = {
OnCalendar = "*:0/10";
Persistent = true;
};
Install = {
WantedBy = ["timers.target"];
};
};
}; };
virtualisation.docker.enable = true; virtualisation.docker.enable = true;

View File

@@ -4,7 +4,7 @@
package = package =
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "himalaya"; name = "himalaya";
runtimeInputs = [pkgs.himalaya]; runtimeInputs = [pkgs.bash pkgs.coreutils pkgs.himalaya];
text = '' text = ''
exec env RUST_LOG="warn,imap_codec::response=error" ${pkgs.himalaya}/bin/himalaya "$@" exec env RUST_LOG="warn,imap_codec::response=error" ${pkgs.himalaya}/bin/himalaya "$@"
''; '';

View File

@@ -35,7 +35,7 @@ Workflow:
- Read the message: `himalaya message read -f "<source>" <id>`. - Read the message: `himalaya message read -f "<source>" <id>`.
- If needed for classification, inspect attachments: `himalaya attachment download -f "<source>" <id> --dir /tmp/himalaya-triage`. - If needed for classification, inspect attachments: `himalaya attachment download -f "<source>" <id> --dir /tmp/himalaya-triage`.
- If attachments are downloaded, inspect them and `rm` the downloaded files from `/tmp/himalaya-triage` after use. - If attachments are downloaded, inspect them and `rm` the downloaded files from `/tmp/himalaya-triage` after use.
- Move: `himalaya message move -f "<source>" <id> "<destination>"`. - Move: `himalaya message move -f "<source>" "<destination>" <id>`.
- Delete: `himalaya message delete -f "<source>" <id>`. - Delete: `himalaya message delete -f "<source>" <id>`.
6. Classification precedence (higher rule wins on conflict): 6. Classification precedence (higher rule wins on conflict):
- Human communication — a message with freeform natural-language content written by a human, not templated or autogenerated. When in doubt whether a message is human or automated, leave it untouched. - Human communication — a message with freeform natural-language content written by a human, not templated or autogenerated. When in doubt whether a message is human or automated, leave it untouched.