diff options
Diffstat (limited to 'oni')
| -rw-r--r-- | oni/home/config/common.scm | 11 | ||||
| -rw-r--r-- | oni/home/config/data.scm | 1 | ||||
| -rw-r--r-- | oni/home/config/pop-os.scm | 148 | ||||
| -rw-r--r-- | oni/home/config/pop-os/emacs.el | 111 | ||||
| -rw-r--r-- | oni/home/services/emacs/org-mem.el | 6 | ||||
| -rw-r--r-- | oni/packages/emacs-config.scm | 39 | ||||
| -rw-r--r-- | oni/packages/emacs.scm | 24 |
7 files changed, 229 insertions, 111 deletions
diff --git a/oni/home/config/common.scm b/oni/home/config/common.scm index 3a91393..2b52f58 100644 --- a/oni/home/config/common.scm +++ b/oni/home/config/common.scm @@ -225,16 +225,7 @@ LocalForward 19999 localhost:19999")) (make-channel-introduction "7677db76330121a901604dfbad19077893865f35" (openpgp-fingerprint - "13E7 6CD6 E649 C28C 3385 4DF5 5E5A A665 6149 17F7")))) - (channel - (name 'guix-rust-past-crates) - (url "https://codeberg.org/guix/guix-rust-past-crates.git") - (branch "trunk") - (introduction - (make-channel-introduction - "1db24ca92c28255b28076792b93d533eabb3dc6a" - (openpgp-fingerprint - "F4C2D1DF3FDEEA63D1D30776ACC66D09CA528292"))))))) + "13E7 6CD6 E649 C28C 3385 4DF5 5E5A A665 6149 17F7"))))))) (define home-zsh-services (list (service home-zsh-service-type diff --git a/oni/home/config/data.scm b/oni/home/config/data.scm index a45c697..2cf41a0 100644 --- a/oni/home/config/data.scm +++ b/oni/home/config/data.scm @@ -159,6 +159,7 @@ (service home-emacs-golden-ratio-service-type) (service home-emacs-pinentry-service-type) (service home-emacs-org-caldav-service-type) + (service home-emacs-org-mem-service-type) (service home-mbsync-service-type) diff --git a/oni/home/config/pop-os.scm b/oni/home/config/pop-os.scm index ab6b7c0..8bae7c7 100644 --- a/oni/home/config/pop-os.scm +++ b/oni/home/config/pop-os.scm @@ -4,21 +4,10 @@ #:use-module ((gnu home services gnupg) #:select (home-gpg-agent-service-type home-gpg-agent-configuration)) - #:use-module ((gnu packages) - #:select (specification->package+output)) - #:use-module ((gnu packages admin) - #:select (htop)) - #:use-module ((gnu packages emacs) - #:select (emacs)) - #:use-module (gnu packages emacs-xyz) - #:use-module ((gnu packages hunspell) - #:select (hunspell - hunspell-dict-en-ca)) - #:use-module ((gnu packages music) - #:select (playerctl)) - #:use-module ((gnu packages pulseaudio) - #:select (pamixer)) - #:use-module (gnu packages xdisorg) + #:use-module (gnu packages) + #:use-module (gnu packages emacs) + #:use-module (gnu packages music) + #:use-module (gnu packages pulseaudio) #:use-module ((gnu services) #:select (service)) #:use-module ((guix gexp) @@ -32,6 +21,7 @@ #:select (home-environment-service)) #:use-module ((oni home services flameshot) #:select (home-flameshot-service-type)) + #:use-module (oni home services git) #:use-module (oni home services herbstluftwm) #:use-module ((oni home services mail) #:select (home-mbsync-service-type)) @@ -39,37 +29,7 @@ #:use-module (oni home services rofi) #:use-module (oni home services xdisorg) #:use-module (oni packages emacs) - #:use-module ((oni packages emacs-config) - #:select (emacs-oni-bookmark - emacs-oni-browse-url - emacs-oni-common-lisp - emacs-oni-compilation - emacs-oni-core - emacs-oni-css - emacs-oni-diff-hl - emacs-oni-dired - emacs-oni-elisp - emacs-oni-git-commit - emacs-oni-grep - emacs-oni-gui - emacs-oni-html - emacs-oni-log-edit - emacs-oni-magit - emacs-oni-org - emacs-oni-org-roam - emacs-oni-package - emacs-oni-php - emacs-oni-project - emacs-oni-projectile - emacs-oni-scheme - emacs-oni-shr - emacs-oni-tramp - emacs-oni-web-mode - emacs-oni-yaml - emacs-oni-lua - emacs-oni-sh - emacs-oni-js - emacs-oni-elfeed)) + #:use-module (oni packages emacs-config) #:use-module ((oni packages fonts) #:select (font-comfortaa font-annotation-mono)) @@ -128,7 +88,7 @@ '(("focus=on") ("class=Emacs" "tag=dev" "index=01" "switchtag=on" "hook=emacs") - ("class~'URxvt|kitty'" "tag=dev" "index=1" + ("class~'URxvt|kitty|wezterm'" "tag=dev" "index=1" "switchtag=on" "hook=urxvt") ("class~'Conkeror|[Ff]irefox|Chromium|glide-glide'" "tag=web" "index=0" "switchtag=on") @@ -206,10 +166,38 @@ (home-module (packages (append foreign-distro-compatibility-packages - (list (specification->package+output "font-fantasque-sans") - (specification->package+output "font-dosis") - (specification->package+output "font-comic-neue") - emacs-oni-core + (map specification->package '("font-fantasque-sans" + "font-dosis" + "wezterm" + "tree-sitter-vue" + "tree-sitter-typescript" + "tree-sitter-css" + "emacs-popup" + "emacs-git-messenger" + "emacs-csv-mode" + "htop" + "emacs-deft" + "emacs-dashboard" + "emacs-typescript-mode" + "hunspell" + "hunspell-dict-en-ca" + "emacs-dired-git-info" + "playerctl" + "pamixer" + ;; need to have a file + ;; /etc/udev/rules.d/40-monitor-hotplug.rules + ;; ACTION=="change", SUBSYSTEM=="drm", RUN+="/var/guix/profiles/per-user/tomwillemsen/guix-home/profile/bin/autorandr --batch --change --default default" + "autorandr" + "emacs-guix" + "emacs-rainbow-identifiers" + "emacs-forge" + "emacs-vundo" + "emacs-sops" + "emacs-dockerfile-mode" + "emacs-slack" + "emacs-combobulate" + "emacs-prodigy")) + (list emacs-oni-core emacs-oni-compilation emacs-oni-common-lisp emacs-oni-browse-url @@ -231,47 +219,28 @@ emacs-oni-grep emacs-oni-shr emacs-oni-css - emacs-dockerfile-mode emacs-oni-yaml - emacs-oni-web-mode + ;; emacs-oni-web-mode emacs-oni-php emacs-oni-projectile - htop - ;; emacs-php-ts-mode emacs-oni-lua emacs-oni-sh - emacs-deft - emacs-dashboard - emacs-flycheck-phpstan - emacs-org-mem - emacs-typescript-mode emacs-oni-js - hunspell - hunspell-dict-en-ca - emacs-dired-git-info emacs-oni-elfeed + emacs-oni-eshell + emacs-oni-outline + emacs-oni-sql + emacs-oni-logview - shutdown-rofi - playerctl - pamixer - ;; need to have a file - ;; /etc/udev/rules.d/40-monitor-hotplug.rules - ;; ACTION=="change", SUBSYSTEM=="drm", RUN+="/var/guix/profiles/per-user/tomwillemsen/guix-home/profile/bin/autorandr --batch --change --default default" - autorandr - - emacs-guix - emacs-rainbow-identifiers - emacs-forge - - emacs-vundo + emacs-flycheck-phpstan + emacs-vue-ts-mode - emacs-sops))) + shutdown-rofi))) (services (append home-zsh-services (list home-channels-service home-dunst-default-service home-environment-service - home-kitty-service home-rofi-default-service (service home-emacs-service-type @@ -294,7 +263,8 @@ "(with-eval-after-load 'project (require 'oni-project))\n" "(require 'oni-gui)\n" "(provide 'oni-gnus)\n" - "(add-to-list 'auto-mode-alist '(\"\\.vue$\" . web-mode))\n"))))) + ;; "(add-to-list 'auto-mode-alist '(\"\\.vue$\" . web-mode))\n" + ))))) (service home-emacs-org-journal-service-type) (service home-wakatime-service-type (home-wakatime-configuration @@ -312,4 +282,22 @@ (home-gpg-agent-configuration (ssh-support? #t) (extra-content - "allow-emacs-pinentry\n")))))))) + "allow-emacs-pinentry\n"))) + + (service home-git-service-type + (home-git-configuration + (user-name "Tom Willemse") + (user-email "tom@ryuslash.org") + (sendemail-sendmailcmd "/usr/bin/msmtp") + (init-default-branch "main") + (init-default-branchname "main") + (advice-detached-head #f) + (extra " +[diff \"org\"] + xfuncname = \"^\\\\*+ +(.+)\" +[diff \"lisp\"] + xfuncname = \"^[[:space:]]*?\\\\(def\\\\w+? ((\\\\w|-|'|:|=|<|>)+)\" +") + (ignore-patterns '("GPATH" "GTAGS" "GRTAGS")))) + + (service home-emacs-org-mem-service-type)))))) diff --git a/oni/home/config/pop-os/emacs.el b/oni/home/config/pop-os/emacs.el index c4aa16e..8b517ef 100644 --- a/oni/home/config/pop-os/emacs.el +++ b/oni/home/config/pop-os/emacs.el @@ -57,18 +57,24 @@ ;; ("t" "Test" artisan-test-transient) ("mm" "Make Migration" artisan-make-migration-transient) ("mM" "Make Model" artisan-make-model-transient) - ("mf" "Make Factory" artisan-make-factory-transient) - ("mFf" "Make Filament Form" artisan-make-filament-form-transient)]) + ("mf" "Make Factory" artisan-make-factory-transient)]) (defun artisan-punt-composer-install () (interactive) (let ((default-directory (expand-file-name "punt" (project-root (project-current))))) (async-shell-command "docker exec -it punt-backend composer install"))) -(defun artisan-chanced-composer-install () - (interactive) - (let ((default-directory (expand-file-name "chanced" (project-root (project-current))))) - (async-shell-command "docker exec -it chanced-backend composer install"))) +(defun artisan-chanced-composer-install (brand) + (interactive + (list (oni-read-brand))) + (mapcar (lambda (b) + (let ((default-directory (expand-file-name b (project-root (project-current)))) + (containers '(("chanced" . "chanced-backend") + ("punt" . "punt-backend") + ("filament" . "chanced-admin-panel")))) + (async-shell-command (format "docker exec -it %s composer install" (map-elt containers b)) + (get-buffer-create (format "*%s-composer*" (upcase b)))))) + (if (string= brand "all") '("chanced" "punt" "filament") (list brand)))) (defun artisan-punt-run-command (command) (interactive @@ -128,8 +134,11 @@ buffers.") (defun oni-read-brand () "Ask for Chanced or Punt." - (nth 1 (read-multiple-choice "Chanced or Punt? " '((?c "chanced" "Chanced") - (?p "punt" "Punt"))))) + (nth 1 (read-multiple-choice "Which application? " + '((?a "all" "All") + (?c "chanced" "Chanced") + (?p "punt" "Punt") + (?f "filament" "Filament"))))) (cl-defun artisan-run-test (name &key file filter stop-on-failure-p) (interactive @@ -147,7 +156,7 @@ buffers.") (command (with-current-buffer buffer (format "../../chanced-scripts/test %s %s %s %s" name - (if filter (format "--filter='::%s$'" filter) "") + (if filter (format "--filter='::%s( |$)'" filter) "") (if stop-on-failure-p "--stop-on-defect" "") (or file ""))))) (cl-letf (((symbol-function 'compilation-buffer-name) @@ -390,9 +399,9 @@ Optional argument STOPP means stop on any defect." (add-hook 'dashboard-mode-hook 'olivetti-mode) (add-hook 'dashboard-after-initialize-hook (lambda () (setq truncate-lines t))) -(setq browse-url-browser-function #'browse-url-firefox) -(setq browse-url-generic-args '("run" "--branch=stable" "--arch=x86_64" "--command=launch-script.sh" "--file-forwarding" "app.zen_browser.zen")) -(setq browse-url-generic-program "/usr/bin/flatpak") +(setq browse-url-browser-function #'browse-url-generic) +(setq browse-url-generic-args nil) +(setq browse-url-generic-program "~/Downloads/glide/glide") (defun oni-fixup-phpstan-filenames (errors) "Change the file name from each error in ERRORS to one on local disk." @@ -1247,8 +1256,10 @@ Optional argument STOPP means stop on any defect." (require 'oni-js) -(with-eval-after-load 'sh-script - (require 'oni-sh)) +(with-eval-after-load 'sh-script (require 'oni-sh)) +(with-eval-after-load 'sql (require 'oni-sql)) +(with-eval-after-load 'outline (require 'oni-outline)) +(with-eval-after-load 'logview (require 'oni-logview)) (eval-when-compile (require 'magit-section)) @@ -1270,5 +1281,73 @@ Optional argument STOPP means stop on any defect." (add-hook 'magit-status-sections-hook #'oni-magit-insert-locked-files 20)) -(setq elfeed-feeds - '("https://www.reddit.com/r/PHP/.rss")) +(with-eval-after-load 'elfeed + (setq elfeed-feeds + '(("https://www.reddit.com/r/PHP/.rss" php) + ("https://phpreads.com/feed" php) + ("https://phpstan.org/rss.xml" php) + ("https://lobste.rs/t/php.rss" php)) + elfeed-curl-program-name "curl")) + +(setq git-messenger:show-detail t) +(global-set-key (kbd "C-c g .") '("Show commit at point" . git-messenger:popup-message)) +(global-set-key (kbd "C-c g b") '("Git Blame current file" . magit-blame)) +(global-set-key (kbd "C-c g l") '("Show file's git log" . magit-log-buffer-file)) + +(defun my-set-agenda-files (&rest _) + (setq org-agenda-files + (cl-loop + for file in (org-mem-all-files) + unless (string-search "archive" file) + when (seq-find (lambda (entry) + (or (org-mem-entry-active-timestamps entry) + (org-mem-entry-todo-state entry) + (org-mem-entry-scheduled entry) + (org-mem-entry-deadline entry))) + (org-mem-entries-in file)) + collect file))) +(add-hook 'org-mem-post-full-scan-functions #'my-set-agenda-files) + +;;; Prodigy services + +(with-eval-after-load 'prodigy + (prodigy-define-tag + :name 'tunnel + :command "~/code/diamond-interactive/social-api/toolbox/connect_db.sh" + :args (lambda (&rest args) + (let ((service (map-elt args :service))) + (list "-e" + (if (prodigy-service-tagged-with? service 'production) + "prd" + "stg") + "-a" + (cond + ((prodigy-service-tagged-with? service 'chanced) + "chanced") + ((prodigy-service-tagged-with? service 'punt) + "punt") + (t (error "Unknown project"))) + "-k" + (expand-file-name "~/.ssh/id_ed25519.pub")))) + :cwd "~/code/diamond-interactive/social-api" + :stop-signal 'kill + :ready-message "Waiting for connections...") + + (prodigy-define-service + :name "Chanced Production Database Connection" + :tags '(chanced production tunnel)) + + (prodigy-define-service + :name "Chanced Staging Database Connection" + :tags '(chanced staging tunnel)) + + (prodigy-define-service + :name "Punt Production Database Connection" + :tags '(punt production tunnel)) + + (prodigy-define-service + :name "Punt Staging Database Connection" + :tags '(punt staging tunnel))) + +(autoload 'vue-ts-mode "vue-ts-mode" nil t) +(add-to-list 'auto-mode-alist (cons (rx ".vue" eos) 'vue-ts-mode)) diff --git a/oni/home/services/emacs/org-mem.el b/oni/home/services/emacs/org-mem.el index e69de29..55b521f 100644 --- a/oni/home/services/emacs/org-mem.el +++ b/oni/home/services/emacs/org-mem.el @@ -0,0 +1,6 @@ +(use-package org-mem + :ensure nil + :init + (setq org-mem-watch-dirs (list (expand-file-name "~/documents/gtd/")) + org-mem-do-sync-with-org-id t) + (org-mem-updater-mode)) diff --git a/oni/packages/emacs-config.scm b/oni/packages/emacs-config.scm index 112267c..6794a62 100644 --- a/oni/packages/emacs-config.scm +++ b/oni/packages/emacs-config.scm @@ -38,7 +38,7 @@ (define-public emacs-oni-config (let - ((commit "ea20080f5ce3a4e7f87455308afc30d21d5a8a24") + ((commit "b3b63e7322acd6fe373454bf5c8a41a97f000938") (revision "0")) (package (name "emacs-oni-config") (version (git-version "0.0.1" revision commit)) @@ -52,10 +52,9 @@ (file-name (git-file-name name version)) (sha256 (base32 - "10vm54szp1dwxlk9gmk22jjq27ci129c0cpg788m6xz8yc69sinf")))) + "0nj8gyzvajza2bsq20a2k1hljsmqw6a18l6bakff4d8l0wbmamzn")))) (build-system emacs-build-system) - (home-page - "https://code.ryuslash.org/emacs-config/") + (home-page "https://code.ryuslash.org/emacs-config/") (synopsis "My Emacs configuration") (description "This package provides my configuration for emacs") @@ -1022,3 +1021,35 @@ Emacs"))) (synopsis "My configuration for JavaScript.") (description "This package provides my configuration for editing JavaScript files."))) + +(define-public emacs-oni-outline + (package + (inherit emacs-oni-config) + (name "emacs-oni-outline") + (arguments + '(#:include '("oni-outline\\.el$"))) + (synopsis "My configuration for outline-mode and outline-minor-mode") + (description + "This package provides my configuration for outline modes."))) + +(define-public emacs-oni-sql + (package + (inherit emacs-oni-config) + (name "emacs-oni-sql") + (arguments + '(#:include '("oni-sql\\.el$"))) + (synopsis "My configuration for sql-mode") + (description + "This package provides my configuration for sql mode."))) + +(define-public emacs-oni-logview + (package + (inherit emacs-oni-config) + (name "emacs-oni-logview") + (arguments + '(#:include '("oni-logview\\.el$"))) + (synopsis "My configuration for logview-mode") + (propagated-inputs + (list emacs-logview)) + (description + "This package provides my configuration for logview mode."))) diff --git a/oni/packages/emacs.scm b/oni/packages/emacs.scm index dbbfc05..105a855 100644 --- a/oni/packages/emacs.scm +++ b/oni/packages/emacs.scm @@ -996,4 +996,26 @@ enabled.") (description "Major mode for editing Phel language source files.") (license license:gpl3+)))) -emacs-phel-mode +(define-public emacs-vue-ts-mode + (let ((commit "efc7031f50bbfd2a3293aee4fcb34bf0503b7f83") + (revision "0")) + (package + (name "emacs-vue-ts-mode") + (version (git-version "0" revision commit)) + (source + (origin + (uri (git-reference + (url "https://github.com/8uff3r/vue-ts-mode.git") + (commit commit))) + (method git-fetch) + (file-name (git-file-name name version)) + (sha256 + (base32 "148czg4vk301ikl60rw2pxmgapmlwz32jkg4jj5dkym0nrcq04vh")))) + (arguments + (list #:include + #~(list "^vue-ts-mode.el"))) + (build-system emacs-build-system) + (home-page "https://github.com/8uff3r/vue-ts-mode") + (synopsis "Emacs major mode for Vue based on Tree-sitter") + (description "Emacs major mode for Vue based on Tree-sitter") + (license license:gpl3+)))) |
