diff --git a/hmModules/emacs/init.el b/hmModules/emacs/init.el index 1686c97..7959261 100644 --- a/hmModules/emacs/init.el +++ b/hmModules/emacs/init.el @@ -927,7 +927,7 @@ This is meant to be an helper to be called from the window manager." (require 'org-roam-protocol) :custom (org-roam-v2-ack t) - (org-roam-directory (file-truename "~/roam")) + (org-roam-directory (file-truename "~/org")) (org-roam-complete-everywhere 't) (org-roam-dailies-capture-templates '( @@ -970,23 +970,23 @@ This is meant to be an helper to be called from the window manager." "Check if node was created in given time range" #'org-roam-node-date #'(lambda (node-date start-date end-date) - (let ((node-date (condition-case nil - ;; if the entry is not from the journal (i.e. the filename is not something like "2024-10-10.org") - ;; then it's always discarded (the epoch time is given to it) - (encode-time (org-parse-time-string node-date)) - (error (encode-time (org-parse-time-string "<1970-01-01>"))))) - (start-date (encode-time (org-parse-time-string start-date))) - (end-date (encode-time (org-parse-time-string end-date)))) - (and (time-less-p start-date node-date) - (time-less-p node-date end-date))) - )) + (let ((node-date (condition-case nil + ;; if the entry is not from the journal (i.e. the filename is not something like "2024-10-10.org") + ;; then it's always discarded (the epoch time is given to it) + (encode-time (org-parse-time-string node-date)) + (error (encode-time (org-parse-time-string "<1970-01-01>"))))) + (start-date (encode-time (org-parse-time-string start-date))) + (end-date (encode-time (org-parse-time-string end-date)))) + (and (time-less-p start-date node-date) + (time-less-p node-date end-date))) + )) (defun ccr/org-roam-spent-hours (client &optional date-start date-end) "Return the total spent hours on something (usually a client)" (let* ((query-tags `(tags ,client "billable")) - (query (if (and date-start date-end) - `(and ,query-tags (date-range ,date-start ,date-end)) - query-tags))) + (query (if (and date-start date-end) + `(and ,query-tags (date-range ,date-start ,date-end)) + query-tags))) (apply #'+(mapcar #'org-roam-node-spent (org-roam-ql-nodes query)))))) (use-package org-roam-ql @@ -1027,13 +1027,6 @@ This is meant to be an helper to be called from the window manager." org-roam-ui-update-on-save t org-roam-ui-open-on-start nil)) -(use-package org-download - :after org - :custom (org-download-image-dir (concat org-roam-directory "/images")) - :bind - (:map org-mode-map - (("M-p" . org-download-clipboard)))) - (use-package gptel :custom (gptel-model 'google/gemini-2.5-flash-preview) @@ -1064,7 +1057,7 @@ This is meant to be an helper to be called from the window manager." (defun ccr/edit-buffer (buffer-name old-string new-string) "In BUFFER-NAME, replace OLD-STRING with NEW-STRING." (with-current-buffer buffer-name - (let ((case-fold-search nil)) ;; Case-sensitive search + (let ((case-fold-search nil)) ;; Case-sensitive search (save-excursion (goto-char (point-min)) (let ((count 0)) @@ -1159,23 +1152,6 @@ This is meant to be an helper to be called from the window manager." :type string :description "The text to append to the buffer.")) :category "emacs") - ,(gptel-make-tool - :function (lambda (buffer text) - (with-current-buffer (get-buffer-create buffer) - (save-excursion - (goto-char (point-max)) - (insert text))) - (format "Appended text to buffer %s" buffer)) - :name "append_to_buffer" - :description "Append text to an Emacs buffer. If the buffer does not exist, it will be created." - :confirm t - :args (list '(:name "buffer" - :type string - :description "The name of the buffer to append text to.") - '(:name "text" - :type string - :description "The text to append to the buffer.")) - :category "emacs") ,(gptel-make-tool :name "EditBuffer" :function #'ccr/edit-buffer @@ -1209,22 +1185,6 @@ This is meant to be an helper to be called from the window manager." :description "Content to write to the buffer" :required t)) :category "edit") - ,(gptel-make-tool - :function (lambda (title body) - (org-roam-capture- - :templates `(("d" "" plain "%?" :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" ,(concat "#+title: ${title}\n\n" body)))) ; override default template - :node (org-roam-node-create :title title) - :props '(:unnarrowed 't :tags "gptel")) - ) - :name "create_org_roam_note" - :description "Create a new org-roam note." - :args (list '(:name "title" - :type string - :description "The name of the note to create. Try to automatically infere it and ask only if dubious.") - '(:name "body" - :type string - :description "The body of the note write in an org language, aovoid starting with an headline as first line. Feel free to exploit the org syntax.")) - :category "org-roam") )) diff --git a/hmModules/unison/default.nix b/hmModules/unison/default.nix deleted file mode 100644 index 081f052..0000000 --- a/hmModules/unison/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, lib, ... }: -{ - home.packages = [ pkgs.unison ]; - services.unison = { - enable = true; - pairs = { - "roam" = { - roots = [ - # Pair of roots to synchronize - "/home/ccr/roam" - "ssh://root@sisko.wg.aciceri.dev//mnt/hd/roam" - ]; - commandOptions = { - auto = "true"; - batch = "true"; - log = "false"; - repeat = "watch"; - sshcmd = lib.getExe pkgs.openssh; - ui = "text"; - }; - }; - }; - }; -} diff --git a/hosts/kirk/default.nix b/hosts/kirk/default.nix index 0ccd677..72cebd5 100644 --- a/hosts/kirk/default.nix +++ b/hosts/kirk/default.nix @@ -28,11 +28,13 @@ "pam" "wireguard-client" "greetd" + "syncthing" "mount-sisko" "adb" "binfmt" "prometheus-exporters" "alloy" + "syncthing" "zerotier" ] ++ [ ./disko.nix ]; diff --git a/hosts/picard/default.nix b/hosts/picard/default.nix index 02271ff..3cbb5d2 100644 --- a/hosts/picard/default.nix +++ b/hosts/picard/default.nix @@ -31,6 +31,7 @@ "wireguard-client" "binfmt" "greetd" + "syncthing" "hass-poweroff" "forgejo-runners" "teamviewer" @@ -98,7 +99,6 @@ "pantalaimon" "moonlight" "gimp" - "unison" ]; extraGroups = [ "plugdev" ]; backupPaths = [ ]; diff --git a/hosts/pike/default.nix b/hosts/pike/default.nix index c1c2579..94b79e2 100644 --- a/hosts/pike/default.nix +++ b/hosts/pike/default.nix @@ -29,6 +29,7 @@ "wireguard-client" "binfmt" "greetd" + # "syncthing" "teamviewer" "sunshine" "mount-sisko" diff --git a/hosts/sisko/default.nix b/hosts/sisko/default.nix index e4a3c17..13a9b0d 100644 --- a/hosts/sisko/default.nix +++ b/hosts/sisko/default.nix @@ -26,6 +26,7 @@ "atuin" "immich" "paperless" + "syncthing" "atticd" "jellyfin" "matrix" @@ -113,7 +114,6 @@ environment.systemPackages = with pkgs; [ cifs-utils - unison ]; powerManagement.scsiLinkPolicy = "med_power_with_dipm"; diff --git a/packages/emacs/packages.nix b/packages/emacs/packages.nix index 4852658..9ab2c44 100644 --- a/packages/emacs/packages.nix +++ b/packages/emacs/packages.nix @@ -188,7 +188,6 @@ let org-roam org-roam-ql org-roam-ui - org-download visual-fill-column consult-org-roam pass