Updated roam backup

This commit is contained in:
2026-06-07 01:27:09 +03:00
parent 2254fd419d
commit 1adc0439ea
4 changed files with 49 additions and 1 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ nix build .#formatter.x86_64-linux
### Deploying
```bash
# Rebuild the azos environment for lauretta (this machine) — use this when asked to "rebuild"
sudo nixos-rebuild switch --flake '.?submodules=1#lauretta'
azos-lauretta-update
nix flake update --flake '.?submodules=1' # Update all inputs
nix flake lock --flake '.?submodules=1' --update-input X # Update specific input
```
+16
View File
@@ -322,6 +322,22 @@ With prefix ARG, prompt for a pattern then select from matches."
(define-key azos/beacon/keymap (kbd "t") #'azos/beacon/tail-log)
#+end_src
** Roam Backup
#+begin_src emacs-lisp
(defvar azos/roam/keymap (make-sparse-keymap)
"Keymap for org-roam commands (M-o r prefix).")
(define-key azos/global-minor-mode/open-keymap (kbd "r") azos/roam/keymap)
(defun azos/roam/backup ()
"Commit and push ~/roam to the remote git repo."
(interactive)
(async-shell-command "roam-backup" "*roam-backup*"))
(define-key azos/roam/keymap (kbd "B") #'azos/roam/backup)
#+end_src
* Provide
#+begin_src emacs-lisp
+30
View File
@@ -0,0 +1,30 @@
{...}: {
config.flake.modules.homeManager.roam-backup = {
lib,
config,
pkgs,
...
}: {
options.azos.roam-backup.enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
};
config = lib.mkIf config.azos.roam-backup.enable {
home.packages = [
(pkgs.writeShellScriptBin "roam-backup" ''
set -e
cd "$HOME/roam"
git add -A
if git diff --cached --quiet; then
echo "Nothing to commit."
else
git commit -m "backup: $(date '+%Y-%m-%d %H:%M')"
fi
git push origin
'')
];
};
};
}
+2
View File
@@ -31,6 +31,7 @@
suiteModules.homeManager.qutebrowser
suiteModules.homeManager.reaper
suiteModules.homeManager.snx-rs
suiteModules.homeManager.roam-backup
suiteModules.homeManager.ytdl
];
@@ -38,6 +39,7 @@
azos.suites.lauretta.enable = true;
azos.name = "Aner Zakobar";
azos.roam-backup.enable = true;
home = {
username = "aner";