diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/alacritty.toml | 47 | ||||
-rw-r--r-- | config/alacritty.yml | 59 | ||||
-rw-r--r-- | config/awesome/rc.lua | 30 | ||||
-rw-r--r-- | config/awesome/zenburn-theme.lua | 142 | ||||
-rw-r--r-- | config/calendars.conf | 14 | ||||
-rw-r--r-- | config/doom/config.org | 271 | ||||
-rw-r--r-- | config/doom/custom.el | 68 | ||||
-rw-r--r-- | config/doom/init.el | 98 | ||||
-rw-r--r-- | config/doom/snippets/org-mode/daily | 25 | ||||
-rw-r--r-- | config/git/attributes | 1 | ||||
-rw-r--r-- | config/guix/shell-authorized-directories | 2 | ||||
-rw-r--r-- | config/mpd/mpd.conf | 2 | ||||
-rw-r--r-- | config/pikaur.conf | 5 | ||||
-rw-r--r-- | config/shepherd/init.d/bitcoin.scm | 58 | ||||
-rw-r--r-- | config/shepherd/init.d/cardano.scm | 16 | ||||
-rw-r--r-- | config/shepherd/init.d/cmk.scm | 3 | ||||
-rw-r--r-- | config/shepherd/init.d/my-daemons.scm | 32 | ||||
-rw-r--r-- | config/shepherd/init.scm | 8 | ||||
l--------- | config/systemd/user/default.target.wants/shepherd.service | 1 | ||||
-rw-r--r-- | config/systemd/user/shepherd.service | 26 | ||||
l--------- | config/systemd/user/sockets.target.wants/mpd.socket | 1 |
21 files changed, 669 insertions, 240 deletions
diff --git a/config/alacritty.toml b/config/alacritty.toml new file mode 100644 index 0000000..e2bafee --- /dev/null +++ b/config/alacritty.toml @@ -0,0 +1,47 @@ +[colors.bright] +black = "#928374" +blue = "#83a598" +cyan = "#8ec07c" +green = "#b8bb26" +magenta = "#d3869b" +red = "#fb4934" +white = "#ebdbb2" +yellow = "#fabd2f" + +[colors.cursor] +cursor = "CellForeground" +text = "CellBackground" + +[colors.dim] +black = "#32302f" +blue = "#076678" +cyan = "#427b58" +green = "#79740e" +magenta = "#8f3f71" +red = "#9d0006" +white = "#928374" +yellow = "#b57614" + +[colors.normal] +black = "#282828" +blue = "#458588" +cyan = "#689d6a" +green = "#98971a" +magenta = "#b16286" +red = "#cc241d" +white = "#a89984" +yellow = "#d79921" + +[colors.primary] +background = "#282828" +bright_foreground = "#fbf1c7" +dim_foreground = "#a89984" +foreground = "#ebdbb2" + +[colors.selection] +background = "CellForeground" +text = "CellBackground" + +[colors.vi_mode_cursor] +cursor = "CellForeground" +text = "CellBackground" diff --git a/config/alacritty.yml b/config/alacritty.yml deleted file mode 100644 index bc8e2e7..0000000 --- a/config/alacritty.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Colors (Gruvbox dark) -colors: - primary: - # hard contrast background - '#1d2021' - background: &gruvbox_dark_bg "#282828" - # soft contrast background - '#32302f' - foreground: "#ebdbb2" - bright_foreground: "#fbf1c7" - dim_foreground: "#a89984" - cursor: - text: CellBackground - cursor: CellForeground - vi_mode_cursor: - text: CellBackground - cursor: CellForeground - # search: - # matches: - # foreground: '#000000' - # background: '#ffffff' - # focused_match: - # foreground: CellBackground - # background: CellForeground - # bar: - # background: '' - # foreground: '' - # line_indicator: - # foreground: None - # background: None - selection: - text: CellBackground - background: CellForeground - bright: - black: "#928374" - red: "#fb4934" - green: "#b8bb26" - yellow: "#fabd2f" - blue: "#83a598" - magenta: "#d3869b" - cyan: "#8ec07c" - white: "#ebdbb2" - normal: - black: *gruvbox_dark_bg - red: "#cc241d" - green: "#98971a" - yellow: "#d79921" - blue: "#458588" - magenta: "#b16286" - cyan: "#689d6a" - white: "#a89984" - dim: - black: "#32302f" - red: "#9d0006" - green: "#79740e" - yellow: "#b57614" - blue: "#076678" - magenta: "#8f3f71" - cyan: "#427b58" - white: "#928374" - # indexed_colors: [] diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 08a5794..f085979 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -44,14 +44,21 @@ local hostname = io.popen("uname -n"):read() -- Setup laptop screen -- awful.spawn.with_shell("nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1") -- load the gpu performance profile saved in home -- awful.spawn.with_shell("xrandr --output eDP-1 --mode 1920x1080 --pos 0x0 --output HDMI-2 --primary --mode 1920x1080 --pos 1920x0") -awful.spawn.with_shell("xrandr --output eDP-1 --mode 1920x1080 --pos 0x360 --output HDMI-2 --primary --mode 3440x1440 --pos 1920x0") -awful.spawn.with_shell("xinput --set-prop \"SYN1B7E:01 06CB:2970 Touchpad\" \"Synaptics Two-Finger Scrolling\" 1 1") +-- awful.spawn.with_shell("xrandr --output eDP-1 --mode 1920x1080 --pos 0x360 --output HDMI-2 --primary --mode 3440x1440 --pos 1920x0") +-- awful.spawn.with_shell("xrandr --output HDMI-A-0 --mode 1920x1080 --rotate right --output DisplayPort-0 --mode 3440x1440 --pos 1080x0") -- vertical +if "obp" == hostname then + awful.spawn.with_shell("xrandr --output eDP --primary --mode 1920x1200 --pos 0x240 --rotate normal --output HDMI-A-0 --mode 3440x1440 --pos 1920x0 --rotate normal") +else + awful.spawn.with_shell("xrandr --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --output DisplayPort-0 --primary --mode 3440x1440 --pos 1920x0") +end +if "titanroam" then + awful.spawn.with_shell("xinput --set-prop \"SYN1B7E:01 06CB:2970 Touchpad\" \"Synaptics Two-Finger Scrolling\" 1 1") +end -- {{{ Variable definitions -- Themes define colours, icons, font and wallpapers. -beautiful.init(gears.filesystem.get_themes_dir() .. "zenburn/theme.lua") - +beautiful.init(string.format("%s/.config/awesome/%s.lua", os.getenv("HOME"), "zenburn-theme")) -- This is used later as the default software to run local tools = { terminal = "alacritty", @@ -63,7 +70,7 @@ local tools = { video = "vlc", pass = "passmenu", rofi_run = "rofi -show combi", - habit = "/home/titan/dev/helpful_scripts/guile/habit.scm", + habit = string.format("%s/dev/dotfiles/bin/habit", os.getenv("HOME")), } -- Default modkey. @@ -80,7 +87,7 @@ awful.layout.layouts = { -- awful.layout.suit.tile.left, -- awful.layout.suit.tile.bottom, -- awful.layout.suit.tile.top, - -- awful.layout.suit.fair.horizontal, + awful.layout.suit.fair.horizontal, awful.layout.suit.spiral, -- awful.layout.suit.spiral.dwindle, -- awful.layout.suit.max, @@ -155,7 +162,7 @@ local tasklist_buttons = gears.table.join( local function set_wallpaper(s) local wallpaper = awful.util.getdir("config") .. "brown-hair-brunette-green-eyes.jpg" - gears.wallpaper.maximized(wallpaper, s, true) + gears.wallpaper.maximized(wallpaper, s, false) end -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) @@ -611,12 +618,15 @@ local function run_once(cmd) awful.spawn.with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") end -run_once("nextcloud") run_once("light-locker") run_once("redshift-gtk") -run_once("udisksctl mount -b /dev/disk/by-label/ext_backup") run_once("nm-applet") -run_once("aw-qt") + +if ("obp" ~= hostname) then + run_once("nextcloud") + run_once("udisksctl mount -b /dev/disk/by-label/ext_backup") + run_once("aw-qt") +end -- Autostart script for keymaps awful.spawn.with_shell("setxkbmap -I~/.config/xkb/ oscar -option caps:escape -print | xkbcomp -I$HOME/.config/xkb/ - $DISPLAY") diff --git a/config/awesome/zenburn-theme.lua b/config/awesome/zenburn-theme.lua new file mode 100644 index 0000000..89aa37c --- /dev/null +++ b/config/awesome/zenburn-theme.lua @@ -0,0 +1,142 @@ +------------------------------- +-- "Zenburn" awesome theme -- +-- By Adrian C. (anrxc) -- +------------------------------- + +local themes_path = require("gears.filesystem").get_themes_dir() +local dpi = require("beautiful.xresources").apply_dpi + +-- {{{ Main +local theme = {} +theme.wallpaper = themes_path .. "zenburn/zenburn-background.png" +-- }}} + +-- {{{ Styles +theme.font = "sans 8" + +-- {{{ Colors +theme.fg_normal = "#DCDCCC" +theme.fg_focus = "#F0DFAF" +theme.fg_urgent = "#CC9393" +theme.bg_normal = "#3F3F3F" +theme.bg_focus = "#1E2320" +theme.bg_urgent = "#3F3F3F" +theme.bg_systray = theme.bg_normal +-- }}} + +-- {{{ Borders +theme.useless_gap = dpi(0) +theme.border_width = dpi(2) +theme.border_normal = "#3F3F3F" +theme.border_focus = "#6F6F6F" +theme.border_marked = "#CC9393" +-- }}} + +-- {{{ Titlebars +theme.titlebar_bg_focus = "#3F3F3F" +theme.titlebar_bg_normal = "#3F3F3F" +-- }}} + +-- There are other variable sets +-- overriding the default one when +-- defined, the sets are: +-- [taglist|tasklist]_[bg|fg]_[focus|urgent|occupied|empty|volatile] +-- titlebar_[normal|focus] +-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] +-- Example: +--theme.taglist_bg_focus = "#CC9393" +-- }}} + +-- {{{ Widgets +-- You can add as many variables as +-- you wish and access them by using +-- beautiful.variable in your rc.lua +--theme.fg_widget = "#AECF96" +--theme.fg_center_widget = "#88A175" +--theme.fg_end_widget = "#FF5656" +--theme.bg_widget = "#494B4F" +--theme.border_widget = "#3F3F3F" +-- }}} + +-- {{{ Mouse finder +theme.mouse_finder_color = "#CC9393" +-- mouse_finder_[timeout|animate_timeout|radius|factor] +-- }}} + +-- {{{ Menu +-- Variables set for theming the menu: +-- menu_[bg|fg]_[normal|focus] +-- menu_[border_color|border_width] +theme.menu_height = dpi(15) +theme.menu_width = dpi(100) +-- }}} + +-- {{{ Icons +-- {{{ Taglist +theme.taglist_squares_sel = themes_path .. "zenburn/taglist/squarefz.png" +theme.taglist_squares_unsel = themes_path .. "zenburn/taglist/squarez.png" +--theme.taglist_squares_resize = "false" +-- }}} + +-- {{{ Misc +theme.awesome_icon = themes_path .. "zenburn/awesome-icon.png" +theme.menu_submenu_icon = themes_path .. "default/submenu.png" +-- }}} + +-- Variables set for theming notifications: +theme.notification_font = "DejaVu Sans 18" +-- notification_[bg|fg] +-- notification_[width|height|margin] +-- notification_[border_color|border_width|shape|opacity] + +-- {{{ Layout +theme.layout_tile = themes_path .. "zenburn/layouts/tile.png" +theme.layout_tileleft = themes_path .. "zenburn/layouts/tileleft.png" +theme.layout_tilebottom = themes_path .. "zenburn/layouts/tilebottom.png" +theme.layout_tiletop = themes_path .. "zenburn/layouts/tiletop.png" +theme.layout_fairv = themes_path .. "zenburn/layouts/fairv.png" +theme.layout_fairh = themes_path .. "zenburn/layouts/fairh.png" +theme.layout_spiral = themes_path .. "zenburn/layouts/spiral.png" +theme.layout_dwindle = themes_path .. "zenburn/layouts/dwindle.png" +theme.layout_max = themes_path .. "zenburn/layouts/max.png" +theme.layout_fullscreen = themes_path .. "zenburn/layouts/fullscreen.png" +theme.layout_magnifier = themes_path .. "zenburn/layouts/magnifier.png" +theme.layout_floating = themes_path .. "zenburn/layouts/floating.png" +theme.layout_cornernw = themes_path .. "zenburn/layouts/cornernw.png" +theme.layout_cornerne = themes_path .. "zenburn/layouts/cornerne.png" +theme.layout_cornersw = themes_path .. "zenburn/layouts/cornersw.png" +theme.layout_cornerse = themes_path .. "zenburn/layouts/cornerse.png" +-- }}} + +-- {{{ Titlebar +theme.titlebar_close_button_focus = themes_path .. "zenburn/titlebar/close_focus.png" +theme.titlebar_close_button_normal = themes_path .. "zenburn/titlebar/close_normal.png" + +theme.titlebar_minimize_button_normal = themes_path .. "default/titlebar/minimize_normal.png" +theme.titlebar_minimize_button_focus = themes_path .. "default/titlebar/minimize_focus.png" + +theme.titlebar_ontop_button_focus_active = themes_path .. "zenburn/titlebar/ontop_focus_active.png" +theme.titlebar_ontop_button_normal_active = themes_path .. "zenburn/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_inactive = themes_path .. "zenburn/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_inactive = themes_path .. "zenburn/titlebar/ontop_normal_inactive.png" + +theme.titlebar_sticky_button_focus_active = themes_path .. "zenburn/titlebar/sticky_focus_active.png" +theme.titlebar_sticky_button_normal_active = themes_path .. "zenburn/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_inactive = themes_path .. "zenburn/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_inactive = themes_path .. "zenburn/titlebar/sticky_normal_inactive.png" + +theme.titlebar_floating_button_focus_active = themes_path .. "zenburn/titlebar/floating_focus_active.png" +theme.titlebar_floating_button_normal_active = themes_path .. "zenburn/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_inactive = themes_path .. "zenburn/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_inactive = themes_path .. "zenburn/titlebar/floating_normal_inactive.png" + +theme.titlebar_maximized_button_focus_active = themes_path .. "zenburn/titlebar/maximized_focus_active.png" +theme.titlebar_maximized_button_normal_active = themes_path .. "zenburn/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_inactive = themes_path .. "zenburn/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_inactive = themes_path .. "zenburn/titlebar/maximized_normal_inactive.png" +-- }}} +-- }}} + +return theme + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/config/calendars.conf b/config/calendars.conf new file mode 100644 index 0000000..f09945f --- /dev/null +++ b/config/calendars.conf @@ -0,0 +1,14 @@ +[DEFAULT] +ahead=90 +back=28 + +[catalyst] +url=https://calendar.google.com/calendar/ical/c_jvsrkmkigu6ibgkmk5dr86bd7g@group.calendar.google.com/public/{}.ics +calendars = basic + +[personal] +user = oscar +passwordstore=CS_storage/cloud.oscarnajera.com/oscar +url=https://cloud.oscarnajera.com/remote.php/dav/calendars/oscar/{}?export +calendars = habitual personal-1 + diff --git a/config/doom/config.org b/config/doom/config.org index 3d203aa..577f1f9 100644 --- a/config/doom/config.org +++ b/config/doom/config.org @@ -11,6 +11,22 @@ #+begin_src emacs-lisp (setq doom-font (font-spec :family "DejaVu Sans Mono" :size 18 :weight 'semi-light)) (setq doom-theme 'doom-gruvbox) +(add-hook 'prog-mode-hook 'prettify-symbols-mode) + +(defun on/prettify-symbols () + "Common added symbols." + (mapc (lambda (p) + (cl-pushnew p prettify-symbols-alist :test #'equal)) + '(("<=" . ?≤) + (">=" . ?≥) + ("->" . ?→) + ("->>" . ?↠) + ("=>" . ?⇒) + ("/=" . ?≠) ("!=" . ?≠) + ("::" . ?∷) + ("lambda" . ?λ)))) + +(add-hook 'prog-mode-hook 'on/prettify-symbols) #+end_src This determines the style of line numbers in effect. If set to `nil', line numbers are disabled. For relative line numbers, set this to `relative'. @@ -88,6 +104,9 @@ Because I always need help and it should come up quickly (emacs-lisp-mode) (display-buffer (current-buffer)))) #+end_src +#+begin_src emacs-lisp + (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) +#+end_src * Dictionary #+begin_src emacs-lisp :tangle "packages.el" (package! lexic) @@ -110,6 +129,7 @@ Shamelessly copied from https://tecosaur.github.io/emacs-config/#dictionary * Orgmode #+begin_src emacs-lisp (after! org + (setq org-tags-column (- fill-column)) (setcdr (assoc "j" org-capture-templates) '("Journal" entry (file+olp+datetree +org-capture-journal-file) "* %(format-time-string \"%H:%M\") %?\n%a\n%i" @@ -119,20 +139,19 @@ Shamelessly copied from https://tecosaur.github.io/emacs-config/#dictionary `("e" "Event" entry (file ,(expand-file-name "caldav.org" org-directory)) "* %?\n%^T\n%i\n%a")) - (add-to-list 'org-capture-templates - `("i" "Isar-Speak Contact" - entry (file ,(expand-file-name "Isar-Speak.org" org-directory)) - "* INTRS [[notmuch-search:%:fromaddress][%:fromname]] -:PROPERTIES: -:EMAIL: %:fromaddress -:END: -Invited: %^t -")) + (setq org-roam-capture-templates '(("d" "default" plain "%i\n%?" :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") :unnarrowed t)) org-roam-capture-ref-templates org-roam-capture-templates)) + +(use-package! semantic-search + :after org + :load-path "~/dev/dotfiles/scratch/semgrep" + :commands (semantic-search) + :config + (setq semantic-server-url "http://localhost:8080")) #+end_src ** Alerts This is to set the reminders of calendar events. @@ -155,13 +174,18 @@ this new window. #+begin_src emacs-lisp (use-package! cal-sync :load-path "~/dev/org-caldav" - :commands (cal-sync-push cal-sync-import-file cal-sync-delete) + :commands (cal-sync-push cal-sync-import-file cal-sync-delete on/calendar-fetch) :init (map! :leader (:prefix-map "mc" "p" #'cal-sync-push "f" #'cal-sync-import-file)) :config - (setq cal-sync-url "https://cloud.oscarnajera.com/remote.php/dav/calendars/oscar" + (defun on/calendar-fetch () + (interactive) + (call-process "org_agenda_sync" + nil (list :file (expand-file-name "~/org/caldav.org")) nil + "--format" "org")) + (setq cal-sync-url "https://oscar@cloud.oscarnajera.com/remote.php/dav/calendars/oscar" cal-sync-calendar-id "personal-1" org-icalendar-date-time-format ":%Y%m%dT%H%M%SZ")) #+end_src @@ -219,23 +243,37 @@ this new window. #+begin_src emacs-lisp (after! elfeed (setq elfeed-feeds - '("https://sachachua.com/blog/feed" + '("http://feeds.feedburner.com/MeltingAsphalt" + "http://feeds.feedburner.com/TroyHunt" + "http://kitchingroup.cheme.cmu.edu/blog/feed/index.xml" "http://www.howardism.org/index.xml" - "https://reyify.com/api/rss" - "https://guix.gnu.org/feeds/blog.atom" "https://ag91.github.io/rss.xml" + "https://architectelevator.com/feed.xml" + "https://bitcoinops.org/feed.xml" + "https://cyberwardog.blogspot.com/feeds/posts/default" "https://daryl.wakatara.com/rss.xml" + "https://guix.gnu.org/feeds/blog.atom" + "https://hboeck.de/rss.xml" + "https://jackrusher.com/feed.xml" "https://nullprogram.com/feed/" + "https://oscarnajera.com/post/index.xml" + "https://paulstamatiou.com/posts.xml" + "https://planet.archlinux.org/atom.xml" + "https://reyify.com/api/rss" + "https://sachachua.com/blog/feed" + "https://serokell.io/blog.rss.xml" + "https://stevelosh.com/rss.xml" + "https://www.archlinux.org/feeds/news/" + "https://www.n16f.net/blog/index.xml" "https://www.schneier.com/feed/atom" - "https://stevelosh.com/rss.xml"))) - + "https://www.tweag.io/rss.xml"))) #+end_src * Email ** Notmuch #+begin_src emacs-lisp :tangle "packages.el" -(package! notmuch :pin "7b5921877e748338359a25dae578771f768183af") -(package! org-mime :pin "a7bf07316f93015e4f853ea0fc5b8d05b4a7695d") -(package! ol-notmuch :pin "126fb446d8fa9e54cf21103afaf506fd81273c02") +(package! notmuch :pin "c769658360e10a6d01a4134e680e2f498741bc5c") +(package! org-mime :pin "cc00afcf0291633324364c1c83bfe2833cfdc1bf") +(package! ol-notmuch :pin "781c3518a537da2a8b5e8a4424f9441df463a147") #+end_src #+BEGIN_SRC emacs-lisp (use-package! notmuch @@ -367,18 +405,14 @@ this new window. (defun on/registered-mail-accounts () "Read mbsync config to extract IMAPAccounts." - (let ((buffer (find-file-noselect - (expand-file-name - "~/dev/dotfiles/mail/dot-mbsyncrc.personal")))) - (with-current-buffer buffer - (goto-char (point-min)) - (let ((pick (prog1 (->> - (cl-loop while (search-forward-regexp (rx bol "IMAPAccount " (group (+ any)) eol) nil t) - collect (match-string 1)) - (cons "all") - (completing-read "Which mailbox"))))) - (kill-buffer buffer) - (if (string= pick "all") nil (list pick)))))) + (with-temp-buffer + (insert-file-contents (expand-file-name "~/.mbsyncrc")) + (let ((pick (thread-last + (cl-loop while (search-forward-regexp (rx bol "IMAPAccount " (group (+ any)) eol) nil t) + collect (match-string 1)) + (cons "all") + (completing-read "Which mailbox")))) + (if (string= pick "all") nil (list pick))))) (define-derived-mode mail-sync-log-mode comint-mode "mail-sync-log" "Major mode for reading mail sync." @@ -407,21 +441,27 @@ this new window. smtpmail-local-domain "oscarnajera.com") (defun set-smtp-server () - (let* ((default-smtp-conf '("mail.oscarnajera.com" 587 starttls "hi")) - (smtp-from-server-alist - '(("Oscar Najera <najera.oscar@gmail.com>" - "smtp.googlemail.com" 587 starttls "najera.oscar"))) - (smtp-conf (alist-get (save-restriction - (message-narrow-to-headers) - (message-fetch-field "from")) - smtp-from-server-alist default-smtp-conf - nil #'string=))) - (-let [(server port protocol user) smtp-conf] - (setq smtpmail-smtp-server server - smtpmail-smtp-service port - smtpmail-stream-type protocol - smtpmail-smtp-user user) - (message "SMTP server changed to %s in port %s by %s" server port protocol)))) + (-let* (((user host) + (thread-first + (message-field-value "from" ) + (mail-extract-address-components) + (cadr) + (string-split "@"))) + (smtp-servers '("oscarnajera.com" "mail.oscarnajera.com" + "gmail.com" "smtp.googlemail.com" + "byteplant.com" "smtp.byteplant.com")) + ((&plist :host :user :port :secret) + (car + (auth-source-search :host + (or (plist-get smtp-servers host #'string=) + "mail.oscarnajera.com") + :user user + :max 1)))) + (setq smtpmail-smtp-server host + smtpmail-smtp-service (string-to-number port) + smtpmail-stream-type 'starttls + smtpmail-smtp-user user) + (message "SMTP server changed to %s %s %s" host port user))) (add-hook 'message-send-mail-hook 'set-smtp-server)) #+end_src @@ -433,6 +473,19 @@ this new window. #+begin_src emacs-lisp (use-package! khardel) #+end_src +* IRC +#+begin_src emacs-lisp +(set-irc-server! "irc.libera.chat" + `(:tls t + :port 6697 + :nick "titan-c" + :sasl-username ,(+pass-get-user "Social/freenode/titan-c") + :sasl-password (lambda (&rest _) (+pass-get-secret "Social/freenode/titan-c")) + :channels ("#emacs" "#guix"))) +#+end_src + +#+RESULTS: + * Ledger Emacs mode for managing ledger text files #+BEGIN_SRC emacs-lisp @@ -442,20 +495,21 @@ Emacs mode for managing ledger text files (defun on/ledger-link-invoice () "Attach an invoice file to this posting." (interactive) + (ledger-navigate-beginning-of-xact) + (end-of-line) (when-let* ((date (ledger-xact-date)) - (payee (replace-regexp-in-string " " "_" (string-trim-right (ledger-xact-payee)))) - (src-file (read-file-name "Attach: " "~/dev/journal/Empresa_DE/")) + (payee (thread-last + (ledger-xact-payee) + (string-trim) + (replace-regexp-in-string (rx (+ (or space punctuation))) "_"))) + (src-file (read-file-name "Attach: ")) (file-name (concat "Empresa_DE/" date "_" payee "." (file-name-extension src-file)))) - (ledger-navigate-beginning-of-xact) - (end-of-line) - (rename-file src-file (expand-file-name file-name "/home/titan/dev/journal/")) - (newline) - (insert " ; Invoice: " file-name)))) + (insert "\n ; Invoice: " file-name) + (rename-file src-file (expand-file-name file-name))))) #+end_src ** CSV #+begin_src emacs-lisp :tangle "packages.el" (package! parse-csv) -(package! emacsql-sqlite3) #+end_src ** Crypto #+begin_src emacs-lisp @@ -465,8 +519,8 @@ Emacs mode for managing ledger text files :init (defun on/cardano-set-network () (interactive) - (let* ((networks '((:mainnet "/tmp/nina-mn.socket" "http://localhost:8090" "--mainnet") - (:preview "/tmp/nina-pr.socket" "http://localhost:8091" "--testnet-magic" "2"))) + (let* ((networks '((:mainnet "/run/cardano-node-mainnet/socket" "http://localhost:8090" "--mainnet") + (:preview "/run/cardano-node-preview/socket" "http://localhost:8091" "--testnet-magic" "2"))) (pick (alist-get (completing-read "Pick network" networks) @@ -485,7 +539,7 @@ Emacs mode for managing ledger text files cardano-wallet-tx-log-mode))))) (setq cardano-tx-log-level 'debug) ;; (setq cardano-cli-command (expand-file-name "~/dev/cardano/cardano-node/cli")) - (setq cardano-tx-cli-command "/home/titan/dev/cardano/cardano-node/dist-newstyle/build/x86_64-linux/ghc-8.10.7/cardano-cli-1.35.3/x/cardano-cli/build/cardano-cli/cardano-cli") + (setq cardano-tx-cli-command "/usr/bin/cardano-cli") (setq cardano-tx-db-keyring-dir "~/dev/cardano/emacs-wallet/keys/demo")) (use-package! cardano-wallet @@ -526,10 +580,33 @@ Emacs mode for managing ledger text files #+begin_src emacs-lisp :tangle "packages.el" (package! emacsql-psql) #+end_src + +#+begin_src emacs-lisp +(after! format-all + (define-format-all-formatter sqlformat + (:executable "pg_format") + (:install) + (:modes sql-mode) + (:format + (format-all--buffer-easy + executable + "-s2" "-g" "-U2" + "-")))) +#+end_src ** WEB +#+begin_src emacs-lisp :tangle "packages.el" +(package! impatient-mode) +#+end_src #+begin_src emacs-lisp -(after! web-mode - (setq-hook! 'web-mode-hook +format-with :none)) +(after! skewer-mode + (setq httpd-port 8095)) + +(use-package! impatient-mode + :commands impatient-mode) + +(use-package! trident-mode + :commands trident-mode + :load-path "~/dev/emacs-lisp/trident-mode.el/") #+end_src ** Haskell #+begin_src emacs-lisp @@ -542,6 +619,36 @@ Emacs mode for managing ledger text files #+begin_src emacs-lisp (setq-hook! 'clojure-mode-hook +format-with :none) #+end_src +** Common Lisp +#+begin_src emacs-lisp +(after! sly + (setq sly-lisp-implementations + '((sbcl-large ("sbcl" "--dynamic-space-size" "2048")) + (sbcl ("sbcl"))))) +#+end_src +** C +#+begin_src emacs-lisp +(after! lsp-clangd + (setq lsp-clients-clangd-args + '("-j=3" + "--background-index" + "--clang-tidy" + "--completion-style=detailed" + "--header-insertion=never" + "--header-insertion-decorators=0")) + (set-lsp-priority! 'clangd 2)) +#+end_src + +* Video Editing +#+begin_src emacs-lisp :tangle "packages.el" +(package! subed + :recipe (:host github :repo "sachac/subed" :files ("subed/*.el"))) +#+end_src + +#+begin_src emacs-lisp +(use-package! subed) +#+end_src + * Admin #+begin_src emacs-lisp :tangle "packages.el" (package! guix) @@ -553,8 +660,43 @@ Emacs mode for managing ledger text files (package! json-rpc) #+end_src #+begin_src emacs-lisp -(use-package! json-rpc) +(use-package! btc-explorer + :load-path "~/dev/emacs-lisp/btc-explorer/" + :commands (on/bitcoin-rpc-connect) + :config + (use-package json-rpc) + (defun on/bitcoin-rpc-connect () + (interactive) + (let* ((networks '(:mainnet 8332 + :mainnet-r 8335 + :testnet 18332 + :testnet-r 18335 + :regtest 18443)) + (host "localhost") + (user "crazy") + (port (plist-get networks + (intern (completing-read "Pick network: " networks)))) + (secret (-some-> + (auth-source-search :host host) + (car) + (plist-get :secret)))) + (when (and btc-explorer-bitcoind + (json-rpc-live-p btc-explorer-bitcoind)) + (json-rpc-close btc-explorer-bitcoind)) + (setq btc-explorer-bitcoind + (json-rpc-connect host port user (funcall secret)))))) + +(use-package! lnd + :load-path "~/dev/emacs-lisp/btc-explorer/" + :commands (lnd-pick-node) + :config + (setq lnd-nodes '(("local" "https://localhost:8480/v1/" + "/run/media/titan/ext_backup/personal/bitcoin/lnd/data/chain/bitcoin/testnet/admin.macaroon") + ("remote" "https://localhost:8481/v1/" + "~/dev/emacs-lisp/btc-explorer/admin.macaroon")))) + #+end_src + #+begin_src emacs-lisp (use-package! shepherd :load-path "~/dev/dotfiles/elisp/" @@ -564,3 +706,12 @@ Emacs mode for managing ledger text files #+begin_src emacs-lisp (use-package! mpc) #+end_src + +#+begin_src emacs-lisp +(use-package! journalctl + :load-path "~/dev/dotfiles/elisp" + :commands (journalctl)) +#+end_src +#+begin_src emacs-lisp +(setq netstat-program-options '("-aptu")) +#+end_src diff --git a/config/doom/custom.el b/config/doom/custom.el index 9ea349e..7ba527d 100644 --- a/config/doom/custom.el +++ b/config/doom/custom.el @@ -3,12 +3,76 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. + '(auth-source-save-behavior nil) '(ignored-local-variable-values '((grep-find-ignored-directories ".git" ".venv" "node_modules" ".mypy_cache" ".pytest_cache" "SCCS" "RCS" "CVS" "MCVS" ".src" ".svn" ".git" ".hg" ".bzr" "_MTN" "_darcs" "{arch}") (grep-find-ignored-files "*.min.js" "*.standalone.js" "*.map" "*.gz" ".#*" "*.o" "*~" "*.bin" "*.lbin" "*.so" "*.a" "*.ln" "*.blg" "*.bbl" "*.elc" "*.lof" "*.glo" "*.idx" "*.lot" "*.fmt" "*.tfm" "*.class" "*.fas" "*.lib" "*.mem" "*.x86f" "*.sparcf" "*.dfsl" "*.pfsl" "*.d64fsl" "*.p64fsl" "*.lx64fsl" "*.lx32fsl" "*.dx64fsl" "*.dx32fsl" "*.fx64fsl" "*.fx32fsl" "*.sx64fsl" "*.sx32fsl" "*.wx64fsl" "*.wx32fsl" "*.fasl" "*.ufsl" "*.fsl" "*.dxl" "*.lo" "*.la" "*.gmo" "*.mo" "*.toc" "*.aux" "*.cp" "*.fn" "*.ky" "*.pg" "*.tp" "*.vr" "*.cps" "*.fns" "*.kys" "*.pgs" "*.tps" "*.vrs" "*.pyc" "*.pyo"))) - '(package-selected-packages '(youtube-sub-extractor elpher adoc-mode logview)) + '(package-selected-packages + '(graphviz-dot-mode elfeed-tube flycheck-elsa elpher adoc-mode logview)) '(safe-local-variable-values - '((cider-default-cljs-repl . shadow) + '((eval let + ((root-dir-unexpanded + (locate-dominating-file default-directory ".dir-locals.el"))) + (when root-dir-unexpanded + (let* + ((root-dir + (file-local-name + (expand-file-name root-dir-unexpanded))) + (root-dir* + (directory-file-name root-dir))) + (unless + (boundp 'geiser-guile-load-path) + (defvar geiser-guile-load-path 'nil)) + (make-local-variable 'geiser-guile-load-path) + (require 'cl-lib) + (cl-pushnew root-dir* geiser-guile-load-path :test #'string-equal)))) + (eval with-eval-after-load 'yasnippet + (let + ((guix-yasnippets + (expand-file-name "etc/snippets/yas" + (locate-dominating-file default-directory ".dir-locals.el")))) + (unless + (member guix-yasnippets yas-snippet-dirs) + (add-to-list 'yas-snippet-dirs guix-yasnippets) + (yas-reload-all)))) + (eval setq-local guix-directory + (locate-dominating-file default-directory ".dir-locals.el")) + (eval add-to-list 'completion-ignored-extensions ".go") + (google-translate-default-source-language . "de") + (google-translate-default-target-language . "en") + (vc-prepare-patches-separately) + (diff-add-log-use-relative-names . t) + (vc-git-annotate-switches . "-w") + (eval eval-after-load "yapfify" + '(defun yapfify-call-bin + (input-buffer output-buffer start-line end-line) + "Call process yapf on INPUT-BUFFER saving the output to OUTPUT-BUFFER. + +Return the exit code. START-LINE and END-LINE specify region to +format." + (with-current-buffer input-buffer + (call-process-region + (point-min) + (point-max) + (concat + (projectile-locate-dominating-file default-directory dir-locals-file) + "scripts/run-pipenv") + nil output-buffer nil "run" "yapf" "-l" + (concat + (number-to-string start-line) + "-" + (number-to-string end-line)))))) + (eval setq flycheck-python-pylint-executable + (concat + (projectile-locate-dominating-file default-directory dir-locals-file) + "scripts/run-pylint")) + (eval setq flycheck-python-mypy-executable + (concat + (projectile-locate-dominating-file default-directory dir-locals-file) + "scripts/run-mypy")) + (grep-find-ignored-directories ".git" ".venv" "node_modules" ".mypy_cache" ".pytest_cache" "SCCS" "RCS" "CVS" "MCVS" ".src" ".svn" ".git" ".hg" ".bzr" "_MTN" "_darcs" "{arch}") + (grep-find-ignored-files "*.min.js" "*.standalone.js" "*.map" "*.gz" ".#*" "*.o" "*~" "*.bin" "*.lbin" "*.so" "*.a" "*.ln" "*.blg" "*.bbl" "*.elc" "*.lof" "*.glo" "*.idx" "*.lot" "*.fmt" "*.tfm" "*.class" "*.fas" "*.lib" "*.mem" "*.x86f" "*.sparcf" "*.dfsl" "*.pfsl" "*.d64fsl" "*.p64fsl" "*.lx64fsl" "*.lx32fsl" "*.dx64fsl" "*.dx32fsl" "*.fx64fsl" "*.fx32fsl" "*.sx64fsl" "*.sx32fsl" "*.wx64fsl" "*.wx32fsl" "*.fasl" "*.ufsl" "*.fsl" "*.dxl" "*.lo" "*.la" "*.gmo" "*.mo" "*.toc" "*.aux" "*.cp" "*.fn" "*.ky" "*.pg" "*.tp" "*.vr" "*.cps" "*.fns" "*.kys" "*.pgs" "*.tps" "*.vrs" "*.pyc" "*.pyo") + (cider-default-cljs-repl . shadow) (cider-shadow-cljs-default-options . "app") (cider-preferred-build-tool . clojure-cli) (cider-clojure-cli-global-options . "-A:dev") diff --git a/config/doom/init.el b/config/doom/init.el index 2bce639..cd9d65d 100644 --- a/config/doom/init.el +++ b/config/doom/init.el @@ -21,49 +21,49 @@ ;;layout ; auie,ctsrnm is the superior home row :completion - company ; the ultimate code completion backend - ;;helm ; the *other* search engine for love and life + company ; the ultimate code completion backend + ;; helm ; the *other* search engine for love and life ;;ido ; the other *other* search engine... - ivy ; a search engine for love and life + ivy ; a search engine for love and life + ;; vertico ; the search engine of the future :ui ;;deft ; notational velocity for Emacs - doom ; what makes DOOM look the way it does - ;;doom-dashboard ; a nifty splash screen for Emacs - doom-quit ; DOOM quit-message prompts when you quit Emacs + doom ; what makes DOOM look the way it does + ;; doom-dashboard ; a nifty splash screen for Emacs + ;;doom-quit ; DOOM quit-message prompts when you quit Emacs ;;(emoji +unicode) ; 🙂 - ;;fill-column ; a `fill-column' indicator - hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW ;;hydra ;;indent-guides ; highlighted indent columns ;;ligatures ; ligatures and symbols to make your code pretty again ;;minimap ; show a map of the code on the side - modeline ; snazzy, Atom-inspired modeline, plus API + modeline ; snazzy, Atom-inspired modeline, plus API ;;nav-flash ; blink cursor line after big motions ;;neotree ; a project drawer, like NERDTree for vim - ophints ; highlight the region an operation acts on + ophints ; highlight the region an operation acts on (popup +defaults) ; tame sudden yet inevitable temporary windows ;;tabs ; a tab bar for Emacs ;;treemacs ; a project drawer, like neotree but cooler ;;unicode ; extended unicode support for various languages - vc-gutter ; vcs diff in the fringe - vi-tilde-fringe ; fringe tildes to mark beyond EOB - window-select ; visually switch windows - workspaces ; tab emulation, persistence & separate workspaces + vc-gutter ; vcs diff in the fringe + vi-tilde-fringe ; fringe tildes to mark beyond EOB + window-select ; visually switch windows + ;;workspaces ; tab emulation, persistence & separate workspaces ;;zen ; distraction-free coding or writing :editor - evil; come to the dark side, we have cookies - file-templates ; auto-snippets for empty files + evil ; come to the dark side, we have cookies + file-templates ; auto-snippets for empty files ;; fold ; (nigh) universal code folding - (format +onsave) ; automated prettiness + (format +onsave) ; automated prettiness ;;god ; run Emacs commands without modifier keys ;;lispy ; vim for lisp, for people who don't like vim ;;multiple-cursors ; editing in many places at once ;;objed ; text object editing for the innocent ;;parinfer ; turn lisp into python, sort of ;;rotate-text ; cycle region at point between text candidates - snippets ; my elves. They type so I don't have to + snippets ; my elves. They type so I don't have to ;;word-wrap ; soft wrapping with language-aware indent :emacs @@ -74,15 +74,15 @@ vc ; version-control and Emacs, sitting in a tree :term - eshell ; the elisp shell that works everywhere + eshell ; the elisp shell that works everywhere ;;shell ; simple shell REPL for Emacs ;;term ; basic terminal emulator for Emacs ;;vterm ; the best terminal emulation in Emacs :checkers - syntax ; tasing you for every semicolon you forget - (spell +flyspell +hunspell) ; tasing you for misspelling mispelling - grammar ; tasing grammar mistake every you make + syntax ; tasing you for every semicolon you forget + (spell +flyspell +hunspell) ; tasing you for misspelling mispelling + grammar ; tasing grammar mistake every you make :tools ;;ansible @@ -92,41 +92,41 @@ ;;docker ;;editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs - (eval +overlay) ; run code, run (also, repls) + (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists - lookup ; navigate your code and its documentation + lookup ; navigate your code and its documentation lsp - magit ; a git porcelain for Emacs + magit ; a git porcelain for Emacs ;;make ; run make tasks from Emacs - (pass +auth) ; password manager for nerds - pdf ; pdf enhancements + (pass +auth) ; password manager for nerds + pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders ;;rgb ; creating color strings ;;taskrunner ; taskrunner for all your projects ;;terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux - tree-sitter ; syntax and parsing, sitting in a tree... + tree-sitter ; syntax and parsing, sitting in a tree... ;;upload ; map local to remote projects via ssh/ftp :os - (:if IS-MAC macos) ; improve compatibility with macOS + (:if IS-MAC macos) ; improve compatibility with macOS ;;tty ; improve the terminal Emacs experience :lang ;;agda ; types of types of types of types... ;;beancount ; mind the GAAP - ;;cc ; C > C++ == 1 + (cc +lsp +tree-sitter) ; C > C++ == 1 clojure ; java with a lisp common-lisp ; if you've seen one lisp, you've seen them all ;;coq ; proofs-as-programs ;;crystal ; ruby at the speed of c ;;csharp ; unity, .NET, and mono shenanigans - data ; config/data formats + data ; config/data formats ;;(dart +flutter) ; paint ui and not much else ;;dhall - ;;elixir ; erlang done right + (elixir +tree-sitter +lsp) ; erlang done right ;;elm ; care for a cup of TEA? - emacs-lisp ; drown in parentheses + emacs-lisp ; drown in parentheses ;;erlang ; an elegant language for a more civilized age ;;ess ; emacs speaks statistics ;;factor @@ -137,27 +137,27 @@ ;;gdscript ; the language you waited for ;;(go +lsp) ; the hipster dialect ;;(graphql +lsp) ; Give queries a REST - (haskell +lsp) ; a language that's lazier than I am + (haskell +lsp) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on - ;;json ; At least it ain't XML + (json +lsp +tree-sitter) ; At least it ain't XML ;;(java +lsp) ; the poster child for carpal tunnel syndrome - (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) - ;;julia ; a better, faster MATLAB + (javascript +lsp +tree-sitter) ; all(hope(abandon(ye(who(enter(here)))))) + (julia +lsp +tree-sitter) ; a better, faster MATLAB ;;kotlin ; a better, slicker Java(Script) ;;latex ; writing papers in Emacs has never been so fun ;;lean ; for folks with too much to prove - ledger ; be audit you can be - lua ; one-based indices? one-based indices - markdown ; writing docs for people to ignore + ledger ; be audit you can be + lua ; one-based indices? one-based indices + markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c - nix ; I hereby declare "nix geht mehr!" + nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel - (org +roam2 +hugo +present) ; organize your plain life in plain text + (org +roam2 +hugo +present +gnuplot +pomodoro) ; organize your plain life in plain text ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional - (python +lsp +ipython) ; beautiful is better than ugly + (python +lsp +ipython +pyright +tree-sitter) ; beautiful is better than ugly ;;qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs ;;raku ; the artist formerly known as perl6 @@ -166,14 +166,14 @@ ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} (rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good - (scheme +guile) ; a fully conniving family of lisps - sh ; she sells {ba,z,fi}sh shells on the C xor + (scheme +guile) ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor ;;sml ;;solidity ; do you need a blockchain? No. ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. - web ; the tubes - yaml ; JSON, but readable + (web +lsp +tree-sitter) ; the tubes + yaml ; JSON, but readable ;;zig ; C, but simpler :email @@ -184,8 +184,8 @@ :app ;;calendar ;;emms - ;;everywhere ; *leave* Emacs!? You must be joking - irc ; how neckbeards socialize + ;; everywhere ; *leave* Emacs!? You must be joking + irc ; how neckbeards socialize rss ; emacs as an RSS reader ;;twitter ; twitter client https://twitter.com/vnought diff --git a/config/doom/snippets/org-mode/daily b/config/doom/snippets/org-mode/daily index f0f24fd..57e60c2 100644 --- a/config/doom/snippets/org-mode/daily +++ b/config/doom/snippets/org-mode/daily @@ -2,17 +2,18 @@ # name: daily # key: daily # -- -- Amazing things that happened yesterday -- How could I have made yesterday even better? -- Daily affirmations -- What would make today great - -- What am I *happy* about in my life now? What about that makes me happy? How does that make me feel? -- What am I *excited* about in my life now? What about that makes me excited? How does that make me feel? -- What am I *proud* about in my life now? What about that makes me proud? How does that make me feel? -- What am I *grateful* for in my life now? what about that makes me grateful? how does that make me feel? -- What am I *enjoying most* in my life right now? what about that do I enjoy? How does that make me feel? -- What am I *committed to* in my life right now? What about that make me committed? How does that make me feel? -- Who do I love? Who loves me? What about that makes me loving? How does that make me feel? +* Routine Review +** Amazing things that happened yesterday +** How could I have made yesterday even better? +** Daily affirmations +** What would make today great +** What makes me feel? And what about that makes me feel that way? :feelings: +- happy :: about in my life now? What about that makes me happy? How does that make me feel? +- excited :: about in my life now? What about that makes me excited? How does that make me feel? +- proud :: about in my life now? What about that makes me proud? How does that make me feel? +- grateful :: for in my life now? what about that makes me grateful? how does that make me feel? +- enjoying most :: in my life right now? what about that do I enjoy? How does that make me feel? +- committed :: to in my life right now? What about that make me committed? How does that make me feel? +- love :: Who do I love? Who loves me? What about that makes me loving? How does that make me feel? - [ ] Timebox day
\ No newline at end of file diff --git a/config/git/attributes b/config/git/attributes index 761502e..1f901af 100644 --- a/config/git/attributes +++ b/config/git/attributes @@ -1,4 +1,5 @@ *.org diff=org +*.ledger diff=ledger *.lisp diff=lisp *.el diff=lisp *.scm diff=lisp diff --git a/config/guix/shell-authorized-directories b/config/guix/shell-authorized-directories new file mode 100644 index 0000000..20cfaa6 --- /dev/null +++ b/config/guix/shell-authorized-directories @@ -0,0 +1,2 @@ +/home/titan/dev/cardano/emacs-wallet +/home/titan/dev/emacs-lisp/btc-explorer/ln-pay diff --git a/config/mpd/mpd.conf b/config/mpd/mpd.conf index 30119e2..5d88caa 100644 --- a/config/mpd/mpd.conf +++ b/config/mpd/mpd.conf @@ -11,6 +11,7 @@ # file:// protocol) or streaming files over an accepted protocol. # music_directory "/run/media/titan/ext_backup/personal/cleaned_music/" +# music_directory "/mnt/disk/personal/cleaned_music/" # # This setting sets the MPD internal playlist directory. The purpose of this # directory is storage for playlists created by MPD. The server will use @@ -26,6 +27,7 @@ playlist_directory "~/.config/mpd/playlists" # files over an accepted protocol. # db_file "/run/media/titan/ext_backup/personal/mpd_database" +# db_file "/mnt/disk/personal/mpd_database" # # These settings are the locations for the daemon log files for the daemon. # These logs are great for troubleshooting, depending on your log_level diff --git a/config/pikaur.conf b/config/pikaur.conf index bf0b064..6c8e171 100644 --- a/config/pikaur.conf +++ b/config/pikaur.conf @@ -10,9 +10,9 @@ keepbuilddir = no keepdevbuilddir = yes keepbuilddeps = no skipfailedbuild = no -alwaysusedynamicusers = no ignorearch = no gpgdir = +dynamicusers = root [review] noedit = no @@ -40,6 +40,9 @@ warnaboutpackageupdates = sudoloopinterval = 59 pacmanpath = pacman privilegeescalationtool = sudo +privilegeescalationtarget = pikaur +userid = 0 +preserveenv = PKGDEST,VISUAL,EDITOR,http_proxy,https_proxy,ftp_proxy,HTTP_PROXY,HTTPS_PROXY,FTP_PROXY,ALL_PROXY [network] aururl = https://aur.archlinux.org diff --git a/config/shepherd/init.d/bitcoin.scm b/config/shepherd/init.d/bitcoin.scm index d576eef..2805b57 100644 --- a/config/shepherd/init.d/bitcoin.scm +++ b/config/shepherd/init.d/bitcoin.scm @@ -1,31 +1,33 @@ +(use-modules (ice-9 popen) + (ice-9 rdelim)) + (define (make-dir-parents dir-path) (unless (access? dir-path F_OK) (make-dir-parents (dirname dir-path)) (mkdir dir-path))) + +(define (bitcoin-rpc-pass) + (let* ((port + (open-input-pipe + "pass show Development/bitcoin/testnet/localhost")) + (result (read-line port))) + (close-pipe port) + result)) + ;; TESTNET ;; Requires the running node which is now under systemd (register-services (make <service> - #:docstring "Electrs testnet" - #:provides '(electrs-testnet) - #:start (make-forkexec-constructor - (list "/home/titan/dev/bitcoin/electrs/target/release/electrs" - "--conf" "/home/titan/dev/bitcoin/electrs/testnet-conf.toml") - #:log-file "/tmp/electrs.log") - #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C - #:respawn? #t)) - -(register-services - (make <service> #:docstring "Bitcoin testnet index" #:provides '(index-testnet) #:start (make-forkexec-constructor (list "/home/titan/dev/bitcoin/rust-bitcoin-indexer/target/release/bitcoin-indexer") - #:directory "/home/titan/dev/bitcoin/rust-bitcoin-indexer/" + #:environment-variables `("DATABASE_URL=postgres://titan@%2Frun%2Fpostgresql/btc-testnet-idx" + ,(format #f "NODE_RPC_URL=http://crazy:~a@127.0.0.1:18332/" (bitcoin-rpc-pass)) + "RUST_LOG=bitcoin_indexer=info") #:log-file "/tmp/btc-indexer.log") #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C - #:requires '(bitcoin-testnet) #:respawn? #t)) (register-services @@ -33,39 +35,27 @@ #:docstring "Bitcoin testnet lnd lightning" #:provides '(lnd-testnet) #:start (make-forkexec-constructor - (list "lnd" + (list "/home/titan/.local/bin/lnd" "--lnddir=/run/media/titan/ext_backup/personal/bitcoin/lnd/" "--noseedbackup")) #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C - #:requires '(bitcoin-testnet) #:respawn? #t)) -;; Mainnet +;; ssh (register-services (make <service> - #:docstring "Sarah tunnel btc" + #:docstring "Sarah ssh tunnel" #:provides '(sarah-ssh) #:start (make-forkexec-constructor (list "ssh" "-NTv" "-o" "ServerAliveInterval=60" "-o" "ExitOnForwardFailure=yes" "-o" "StreamLocalBindUnlink=yes" - "-L" "8332:localhost:8332" - "-L" "8333:localhost:8333" - "sarah") - #:log-file "/tmp/sarah-ssh.log") - #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C - #:respawn? #t)) - -(register-services - (make <service> - #:docstring "Electrs mainnet" - #:provides '(electrs-mainnet) - #:start (make-forkexec-constructor - (list "/home/titan/dev/bitcoin/electrs/target/release/electrs" - "--conf" "/home/titan/dev/bitcoin/electrs/mainnet-conf.toml") - #:log-file "/tmp/electrs-m.log") + "-L" "8335:localhost:8332" ;; btcm + "-L" "18335:localhost:18332" ;; btct + "-L" "8481:localhost:8480" ;; LNDT + "orchest@sarah") + #:log-file "/tmp/sarah-ssh.log" + #:environment-variables '("SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh")) #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C - #:requires '(sarah-ssh) #:respawn? #t)) - diff --git a/config/shepherd/init.d/cardano.scm b/config/shepherd/init.d/cardano.scm index b8efbca..1c5b731 100644 --- a/config/shepherd/init.d/cardano.scm +++ b/config/shepherd/init.d/cardano.scm @@ -19,7 +19,8 @@ "-L" "50001:localhost:50001" ;; electrs "-L" "24224:localhost:24224" ;; electrs monitoring "cardano@nina") - #:log-file "/tmp/nina-ssh.log") + #:log-file "/tmp/nina-ssh.log" + #:environment-variables '("SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh")) #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C #:respawn? #t)) @@ -29,7 +30,7 @@ #:provides '(preview-wallet) #:start (make-forkexec-constructor (list "cardano-wallet" - ;;(string-append (getenv "HOME") "/.cabal/bin/cardano-wallet") + ;;(string-append (getenv "HOME") "/.cabal/bin/cardano-wallet") "serve" "--port" "8091" "--node-socket" "/tmp/nina-pr.socket" @@ -47,11 +48,10 @@ #:start (make-forkexec-constructor (list ;;(string-append (getenv "HOME") "/.cabal/bin/cardano-wallet") "cardano-wallet" - "serve" - "+RTS" "-T" "-RTS" - "--node-socket" "/tmp/nina-mn.socket" - "--database" (string-append (getenv "HOME") "/test-cardano/main/wallet") - "--mainnet") + "serve" + "--node-socket" "/run/cardano-node-mainnet/socket" + "--database" (string-append (getenv "HOME") "/test-cardano/main/wallet") + "--mainnet") #:log-file (string-append (getenv "HOME") "/test-cardano/main/log/wallet.log")) #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C - #:requires '(nina-ssh))) + #:requires '())) diff --git a/config/shepherd/init.d/cmk.scm b/config/shepherd/init.d/cmk.scm index 4c98f1c..97ced9f 100644 --- a/config/shepherd/init.d/cmk.scm +++ b/config/shepherd/init.d/cmk.scm @@ -9,6 +9,7 @@ "-o" "StreamLocalBindUnlink=yes" "-L" "/tmp/ingridcmk.socket:/omd/sites/ingrid/tmp/run/live" "ingrid@ingrid") - #:log-file "/tmp/ingrid-cmk.log") + #:log-file "/tmp/ingrid-cmk.log" + #:environment-variables '("SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh")) #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C #:respawn? #t)) diff --git a/config/shepherd/init.d/my-daemons.scm b/config/shepherd/init.d/my-daemons.scm new file mode 100644 index 0000000..1b5daf8 --- /dev/null +++ b/config/shepherd/init.d/my-daemons.scm @@ -0,0 +1,32 @@ + +(register-services + (make <service> + #:docstring "Habit tracker" + #:provides '(habit-logs) + #:start (make-forkexec-constructor + (list "sbcl" + "--load" + (string-append (getenv "HOME") "/dev/common-lisp/todo-demo/habit.asd") + "--eval" "(asdf:load-system :habit)" + "--eval" "(habit-log::main)" + "--non-interactive") + #:directory (string-append (getenv "HOME") "/dev/common-lisp/todo-demo/") + #:environment-variables (list (string-append "HABIT_DIR=" (getenv "HOME") "/org/habits/") + "PORT=4242") + #:log-file "/tmp/habits.log") + #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C + #:respawn? #t)) + +(let ((workdir (string-append (getenv "HOME") "/dev/dotfiles/scratch/semgrep/"))) + (register-services + (make <service> + #:docstring "Roam semantic DB" + #:provides '(roam-semantic-db) + #:start (make-forkexec-constructor + (list "python" + (string-append workdir "server.py")) + #:directory workdir + #:environment-variables (list (string-append "PATH=" (getenv "HOME") "/.virtualenvs/language/bin")) + #:log-file "/tmp/roam-semantic.log") + #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C + #:respawn? #t))) diff --git a/config/shepherd/init.scm b/config/shepherd/init.scm index 7b548e9..3d47bd4 100644 --- a/config/shepherd/init.scm +++ b/config/shepherd/init.scm @@ -1,14 +1,14 @@ ;; init.scm -- default shepherd configuration file. -(use-modules ((ice-9 ftw) #:select (scandir))) +(use-modules ((ice-9 ftw) #:select (scandir)) + (srfi srfi-26)) ;; Load all the files in the directory 'init.d' with a suffix '.scm'. (for-each (lambda (file) (load (string-append "init.d/" file))) (scandir (string-append (dirname (current-filename)) "/init.d") - (lambda (file) - (string-suffix? ".scm" file)))) + (cut string-suffix? ".scm" <>))) ;; Services known to shepherd: @@ -22,4 +22,4 @@ ;; Services to start when shepherd starts: ;; Add the name of each service that should be started to the list ;; below passed to 'for-each'. -(for-each start '()) +(for-each start '(habit-logs roam-semantic-db)) diff --git a/config/systemd/user/default.target.wants/shepherd.service b/config/systemd/user/default.target.wants/shepherd.service new file mode 120000 index 0000000..f25096b --- /dev/null +++ b/config/systemd/user/default.target.wants/shepherd.service @@ -0,0 +1 @@ +/home/titan/.config/systemd/user/shepherd.service
\ No newline at end of file diff --git a/config/systemd/user/shepherd.service b/config/systemd/user/shepherd.service new file mode 100644 index 0000000..b57d7ec --- /dev/null +++ b/config/systemd/user/shepherd.service @@ -0,0 +1,26 @@ +# -*- mode: conf-unix; -*- +[Unit] +Description=GNU Shepherd Daemon +After=network.target +Wants=guix-daemon.service + +[Service] +Type=forking +ExecStart=/usr/bin/bash -c "source $GUIX_PROFILE/etc/profile && shepherd" +ExecStop=herd stop root +ExecStopPost=rm %t/shepherd/socket -v +# disallow writing to /usr, /bin, /sbin, ... +# ProtectSystem=yes +Environment="GUIX_PROFILE=%h/.guix-profile" +Environment="GUIX_LOCPATH=%h/.guix-profile/lib/locale" + +# # more paranoid security settings +# NoNewPrivileges=yes +# ProtectKernelTunables=yes +# ProtectControlGroups=yes +# # AF_NETLINK is required by libsmbclient, or it will exit() .. *sigh* +# RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK +# RestrictNamespaces=yes + +[Install] +WantedBy=default.target diff --git a/config/systemd/user/sockets.target.wants/mpd.socket b/config/systemd/user/sockets.target.wants/mpd.socket new file mode 120000 index 0000000..ac109b9 --- /dev/null +++ b/config/systemd/user/sockets.target.wants/mpd.socket @@ -0,0 +1 @@ +/usr/lib/systemd/user/mpd.socket
\ No newline at end of file |