diff --git a/hmModules/emacs/init.el b/hmModules/emacs/init.el index 435ad0a..e630922 100644 --- a/hmModules/emacs/init.el +++ b/hmModules/emacs/init.el @@ -787,30 +787,11 @@ This is meant to be an helper to be called from the window manager." (defun org-roam-node-date (node) "Return the org datestring when a node was created (obtained from the filename)" (format "<%s>" (file-name-sans-extension (file-name-nondirectory (org-roam-node-file node))))) - - (org-roam-ql-defpred - 'date-range - "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))) - )) - (defun ccr/org-roam-spent-hours (client &optional date-start date-end) + (defun ccr/org-roam-spent-hours (client) "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))) - (apply #'+(mapcar #'org-roam-node-spent (org-roam-ql-nodes query)))))) + (apply #'+(mapcar #'org-roam-node-spent (org-roam-ql-nodes `(tags ,client "billable"))))) + ) (use-package org-roam-ql :after org-roam diff --git a/hmModules/email/default.nix b/hmModules/email/default.nix index ab37b05..5ae160a 100644 --- a/hmModules/email/default.nix +++ b/hmModules/email/default.nix @@ -22,183 +22,183 @@ ); }; - # home.file.".config/aerc/stylesets" = - # let - # catppuccin-aerc = pkgs.fetchFromGitHub { - # owner = "catppuccin"; - # repo = "aerc"; - # rev = "ca404a9f2d125ef12db40db663d43c9d94116a05"; - # hash = "sha256-OWIkHsKFts/zkrDUtbBPXHVSrHL/F0v3LB1rnlFAKmE="; - # }; - # in - # { - # source = "${catppuccin-aerc}/dist"; - # recursive = true; - # }; + home.file.".config/aerc/stylesets" = + let + catppuccin-aerc = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "aerc"; + rev = "ca404a9f2d125ef12db40db663d43c9d94116a05"; + hash = "sha256-OWIkHsKFts/zkrDUtbBPXHVSrHL/F0v3LB1rnlFAKmE="; + }; + in + { + source = "${catppuccin-aerc}/dist"; + recursive = true; + }; - # programs.aerc = { - # enable = true; - # extraBinds = { - # global = { - # "" = ":prev-tab"; - # "" = ":next-tab"; - # "?" = ":help keys"; - # }; + programs.aerc = { + enable = true; + extraBinds = { + global = { + "" = ":prev-tab"; + "" = ":next-tab"; + "?" = ":help keys"; + }; - # messages = { - # "h" = ":prev-tab"; - # "l" = ":next-tab"; + messages = { + "h" = ":prev-tab"; + "l" = ":next-tab"; - # "j" = ":next"; - # "" = ":next"; - # "" = ":next 50%"; - # "" = ":next 100%"; - # "" = ":next 100%"; + "j" = ":next"; + "" = ":next"; + "" = ":next 50%"; + "" = ":next 100%"; + "" = ":next 100%"; - # "k" = ":prev"; - # "" = ":prev"; - # "" = ":prev 50%"; - # "" = ":prev 100%"; - # "" = ":prev 100%"; - # "g" = ":select 0"; - # "G" = ":select -1"; + "k" = ":prev"; + "" = ":prev"; + "" = ":prev 50%"; + "" = ":prev 100%"; + "" = ":prev 100%"; + "g" = ":select 0"; + "G" = ":select -1"; - # "J" = ":next-folder"; - # "K" = ":prev-folder"; - # "H" = ":collapse-folder"; - # "L" = ":expand-folder"; + "J" = ":next-folder"; + "K" = ":prev-folder"; + "H" = ":collapse-folder"; + "L" = ":expand-folder"; - # "v" = ":mark -t"; - # "x" = ":mark -t:next"; - # "V" = ":mark -v"; + "v" = ":mark -t"; + "x" = ":mark -t:next"; + "V" = ":mark -v"; - # "T" = ":toggle-threads"; + "T" = ":toggle-threads"; - # "" = ":view"; - # "d" = ":prompt 'Really delete this message?' 'delete-message'"; - # "D" = ":delete"; - # "A" = ":archive flat"; + "" = ":view"; + "d" = ":prompt 'Really delete this message?' 'delete-message'"; + "D" = ":delete"; + "A" = ":archive flat"; - # "C" = ":compose"; + "C" = ":compose"; - # "rr" = ":reply -a"; - # "rq" = ":reply -aq"; - # "Rr" = ":reply"; - # "Rq" = ":reply -q"; + "rr" = ":reply -a"; + "rq" = ":reply -aq"; + "Rr" = ":reply"; + "Rq" = ":reply -q"; - # "c" = ":cf"; - # "$" = ":term"; - # "!" = ":term"; - # "|" = ":pipe"; + "c" = ":cf"; + "$" = ":term"; + "!" = ":term"; + "|" = ":pipe"; - # "/" = ":search"; - # "\\" = ":filter"; - # "n" = ":next-result"; - # "N" = ":prev-result"; - # "" = ":clear"; - # }; + "/" = ":search"; + "\\" = ":filter"; + "n" = ":next-result"; + "N" = ":prev-result"; + "" = ":clear"; + }; - # "messages:folder=Drafts" = { - # "" = ":recall"; - # }; + "messages:folder=Drafts" = { + "" = ":recall"; + }; - # view = { - # "/" = ":toggle-key-passthrough/"; - # "q" = ":close"; - # "O" = ":open"; - # "S" = ":save"; - # "|" = ":pipe"; - # "D" = ":delete"; - # "A" = ":archive flat"; + view = { + "/" = ":toggle-key-passthrough/"; + "q" = ":close"; + "O" = ":open"; + "S" = ":save"; + "|" = ":pipe"; + "D" = ":delete"; + "A" = ":archive flat"; - # "" = ":open-link "; + "" = ":open-link "; - # "f" = ":forward"; - # "rr" = ":reply -a"; - # "rq" = ":reply -aq"; - # "Rr" = ":reply"; - # "Rq" = ":reply -q"; + "f" = ":forward"; + "rr" = ":reply -a"; + "rq" = ":reply -aq"; + "Rr" = ":reply"; + "Rq" = ":reply -q"; - # "H" = ":toggle-headers"; - # "" = ":prev-part"; - # "" = ":next-part"; - # "J" = ":next"; - # "K" = ":prev"; - # }; + "H" = ":toggle-headers"; + "" = ":prev-part"; + "" = ":next-part"; + "J" = ":next"; + "K" = ":prev"; + }; - # "view::passthrough" = { - # "$noinherit" = true; - # "$ex" = ""; - # "" = ":toggle-key-passthrough"; - # }; + "view::passthrough" = { + "$noinherit" = true; + "$ex" = ""; + "" = ":toggle-key-passthrough"; + }; - # compose = { - # "$noinherit" = "true"; - # "$ex" = ""; - # "" = ":prev-field"; - # "" = ":next-field"; - # "" = ":switch-account -p"; - # "" = ":switch-account -n"; - # "" = ":next-field"; - # "" = ":prev-tab"; - # "" = ":next-tab"; - # }; + compose = { + "$noinherit" = "true"; + "$ex" = ""; + "" = ":prev-field"; + "" = ":next-field"; + "" = ":switch-account -p"; + "" = ":switch-account -n"; + "" = ":next-field"; + "" = ":prev-tab"; + "" = ":next-tab"; + }; - # "compose::editor" = { - # "$noinherit" = "true"; - # "$ex" = ""; - # "" = ":prev-field"; - # "" = ":next-field"; - # "" = ":prev-tab"; - # "" = ":next-tab"; - # }; + "compose::editor" = { + "$noinherit" = "true"; + "$ex" = ""; + "" = ":prev-field"; + "" = ":next-field"; + "" = ":prev-tab"; + "" = ":next-tab"; + }; - # "compose::review" = { - # "y" = ":send"; - # "n" = ":abort"; - # "p" = ":postpone"; - # "q" = ":choose -o d discard abort -o p postpone postpone"; - # "e" = ":edit"; - # "a" = ":attach"; - # "d" = ":detach"; - # }; + "compose::review" = { + "y" = ":send"; + "n" = ":abort"; + "p" = ":postpone"; + "q" = ":choose -o d discard abort -o p postpone postpone"; + "e" = ":edit"; + "a" = ":attach"; + "d" = ":detach"; + }; - # terminal = { - # "$noinherit" = "true"; - # "$ex" = ""; + terminal = { + "$noinherit" = "true"; + "$ex" = ""; - # "" = ":prev-tab"; - # "" = ":next-tab"; - # }; - # }; - # extraConfig = { - # general.unsafe-accounts-conf = true; - # ui = { - # styleset-name = "catppuccin-mocha"; - # this-day-time-format = ''" 15:04"''; - # this-year-time-format = "Mon Jan 02 15:04"; - # timestamp-format = "2006-01-02 15:04"; + "" = ":prev-tab"; + "" = ":next-tab"; + }; + }; + extraConfig = { + general.unsafe-accounts-conf = true; + ui = { + styleset-name = "catppuccin-mocha"; + this-day-time-format = ''" 15:04"''; + this-year-time-format = "Mon Jan 02 15:04"; + timestamp-format = "2006-01-02 15:04"; - # spinner = "[ ⡿ ],[ ⣟ ],[ ⣯ ],[ ⣷ ],[ ⣾ ],[ ⣽ ],[ ⣻ ],[ ⢿ ]"; - # border-char-vertical = "┃"; - # border-char-horizontal = "━"; - # }; - # viewer = { - # always-show-mime = true; - # }; - # compose = { - # no-attachment-warning = "^[^>]*attach(ed|ment)"; - # }; - # filters = { - # "text/plain" = "colorize"; - # "text/html" = "html"; - # "text/calendar" = "calendar"; - # "message/delivery-status" = "colorize"; - # "message/rfc822" = "colorize"; - # "image/*" = "${pkgs.catimg}/bin/catimg -"; - # }; - # }; - # }; + spinner = "[ ⡿ ],[ ⣟ ],[ ⣯ ],[ ⣷ ],[ ⣾ ],[ ⣽ ],[ ⣻ ],[ ⢿ ]"; + border-char-vertical = "┃"; + border-char-horizontal = "━"; + }; + viewer = { + always-show-mime = true; + }; + compose = { + no-attachment-warning = "^[^>]*attach(ed|ment)"; + }; + filters = { + "text/plain" = "colorize"; + "text/html" = "html"; + "text/calendar" = "calendar"; + "message/delivery-status" = "colorize"; + "message/rfc822" = "colorize"; + "image/*" = "${pkgs.catimg}/bin/catimg -"; + }; + }; + }; programs.notmuch = { enable = true; diff --git a/hmModules/foot/default.nix b/hmModules/foot/default.nix index 840b866..e8ac8d3 100644 --- a/hmModules/foot/default.nix +++ b/hmModules/foot/default.nix @@ -10,7 +10,7 @@ lib.mkMerge [ server.enable = true; settings = { main = { - term = "xterm-direct"; + term = "xterm-256color"; login-shell = "yes"; dpi-aware = "no"; horizontal-letter-offset = "1"; diff --git a/hmModules/shell/default.nix b/hmModules/shell/default.nix index 048a65f..22ced2b 100644 --- a/hmModules/shell/default.nix +++ b/hmModules/shell/default.nix @@ -3,7 +3,6 @@ pkgs, age, hostname, - config, ... }: { @@ -48,19 +47,13 @@ Install = { WantedBy = [ "default.target" ]; }; - Service = { - # ExecStartPre = "${lib.getExe' pkgs.toybox "rm"} -f ${config.programs.atuin.settings.daemon.socket_path}"; - ExecStart = "${lib.getExe pkgs.atuin} daemon"; - }; + Service.ExecStart = "${lib.getExe pkgs.atuin} daemon"; }; programs.atuin = { enable = true; settings = { - daemon = { - enabled = true; - socket_path = "/home/ccr/.local/share/atuin/atuin.sock"; # FIXME using ~ or $HOME doesn't work: https://github.com/atuinsh/atuin/issues/2289 - }; + daemon.enabled = true; auto_sync = true; sync_frequency = "5m"; sync_address = "http://sisko.fleet:8889"; diff --git a/hosts/default.nix b/hosts/default.nix index 5636017..0498e19 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -115,6 +115,7 @@ owner = "grafana"; group = "forgejo"; }; + "garmin-collector-environment".owner = "garmin-collector"; }; }; }; diff --git a/hosts/sisko/default.nix b/hosts/sisko/default.nix index ba45c12..6295c63 100644 --- a/hosts/sisko/default.nix +++ b/hosts/sisko/default.nix @@ -25,6 +25,7 @@ "prometheus-exporters" "loki" "promtail" + "garmin-collector" "restic" "atuin" "immich" @@ -62,18 +63,10 @@ ]; boot.kernelParams = [ - "earlycon" - "consoleblank=0" "console=tty1" - "console=ttyS2,1500000" + "console=ttyS0,1500000" ]; - systemd.services."serial-getty@ttyS2" = { - enable = true; - wantedBy = [ "getty.target" ]; - serviceConfig.restart = "always"; - }; - environment.persistence."/persist" = { hideMounts = true; directories = [ diff --git a/modules/restic/default.nix b/modules/restic/default.nix index 7aedfcd..c3ba948 100644 --- a/modules/restic/default.nix +++ b/modules/restic/default.nix @@ -55,19 +55,5 @@ in ]; timerConfig.OnCalendar = "daily"; timerConfig.RandomizedDelaySec = "1h"; - backupPrepareCommand = '' - ${pkgs.systemd}/bin/systemctl stop podman-* - ${pkgs.systemd}/bin/systemctl stop syncthing - ${pkgs.systemd}/bin/systemctl stop paperless-* - ${pkgs.systemd}/bin/systemctl stop forgejo - ${pkgs.systemd}/bin/systemctl stop home-assistant - ''; - backupCleanupCommand = '' - ${pkgs.systemd}/bin/systemctl start --no-block --all "podman-*" - ${pkgs.systemd}/bin/systemctl start syncthing - ${pkgs.systemd}/bin/systemctl start --no-block --all "paperless-*" - ${pkgs.systemd}/bin/systemctl start forgejo - ${pkgs.systemd}/bin/systemctl start home-assistant - ''; }; } diff --git a/modules/syncthing/default.nix b/modules/syncthing/default.nix index b1b9857..eb25947 100644 --- a/modules/syncthing/default.nix +++ b/modules/syncthing/default.nix @@ -20,7 +20,7 @@ ]; }; sisko = { - id = "TOC7QXZ-JLB4LYP-VNIJAV5-DCKVGFN-UE45SPX-PPFJHSG-O3UHFCK-2PEMAQ6"; + id = "5JYQLMP-KNBMSOE-I452UDU-UTKPXJI-K27X2DI-MSCSRCG-6V54Q6U-NVGXPQA"; addresses = [ "tcp://sisko.fleet" ];