nix-config/modules/scripts/todo.nix
Oliver Davies 10a38aa3e2
All checks were successful
/ check (push) Successful in 1m30s
Run the Git commands within the notes repository
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
2025-10-02 00:07:20 +01:00

34 lines
705 B
Nix

{ withSystem, ... }:
let
name = "todo";
in
{
perSystem =
{ pkgs, ... }:
{
packages.${name} = pkgs.writeShellApplication {
inherit name;
runtimeInputs = with pkgs; [ coreutils ];
text = ''
"$EDITOR" +3 "$TODO_FILE"
cd "$NOTES_DIRECTORY"
git add "$TODO_FILE"
git commit -m "Update TODOs"
git push
'';
};
};
flake.modules.homeManager.base =
{ config, pkgs, ... }:
{
home.packages = [
(withSystem pkgs.system (psArgs: psArgs.config.packages.${name}))
];
home.sessionVariables.TODO_FILE = "${config.home.sessionVariables.NOTES_DIRECTORY}/todo.adoc";
};
}