diff options
author | Robby Zambito <contact@robbyzambito.me> | 2025-07-28 15:13:53 -0400 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2025-07-28 17:50:28 -0400 |
commit | da371d16567b80039629ec6b2046f10df5579172 (patch) | |
tree | 0aefc38a998a44070c3b77d6cf22b308697b0079 |
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | README.org | 0 | ||||
-rw-r--r-- | config-generation/sexp.sld | 44 | ||||
-rw-r--r-- | config-generation/sway.sld | 193 | ||||
-rw-r--r-- | home.bash_profile | 17 | ||||
-rw-r--r-- | home.bashrc | 42 | ||||
-rw-r--r-- | home.scm | 1142 | ||||
-rwxr-xr-x | reconfigure | 0 | ||||
-rwxr-xr-x | reconfigure-home | 3 | ||||
-rwxr-xr-x | reconfigure-system | 3 | ||||
-rw-r--r-- | sway-config | 235 | ||||
-rw-r--r-- | system.scm | 254 | ||||
-rw-r--r-- | wofi/config | 23 | ||||
-rw-r--r-- | wofi/style.css | 72 |
14 files changed, 2031 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6da34b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +secrets.scm +mbsyncrc diff --git a/README.org b/README.org new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/README.org diff --git a/config-generation/sexp.sld b/config-generation/sexp.sld new file mode 100644 index 0000000..782d74d --- /dev/null +++ b/config-generation/sexp.sld @@ -0,0 +1,44 @@ +(define-library (config-generation sexp) + (export ;sexps->string + scm->string) + (import (scheme base) + (scheme write) + (srfi 1) ;list + ;; (srfi 41) ;Streams + ;; (ice-9 pretty-print) + ;; (ice-9 ports) + ) + (begin + ;; (define-syntax sexps->string + ;; (syntax-rules () + ;; ((_ sexp) + ;; (with-output-to-string + ;; (lambda () + ;; (pretty-print 'sexp)))) + ;; ((_ sexp sexps ...) + ;; (string-append (sexps->string sexp) (sexps->string sexps ...))))) + + ;; (define (repeat-string s n) + ;; (string-join (stream->list (stream-take n (stream-constant s))) "")) + + ;; (define-syntax sexps->yaml-tree + ;; (syntax-rules (indentation list) + ;; ((_ indentation i (key value ...)) + ;; (string-append + ;; (repeat-string "\t" i) + ;; (symbol->string 'key) ":\t" (sexps->yaml-tree indentation (+ i 1) value ...))) + ;; ((_ indentation i value) + ;; (cond + ;; ((symbol? 'value) (symbol->string 'value)) + ;; (else value))) + ;; ((_ expression ...) + ;; (sexps->yaml-tree indentation 0)))) + (define (scm->string scm) + (if (null? scm) + "" + (string-append + (let ((out (open-output-string))) + (write (first scm) out) + (get-output-string out)) + "\n" + (scm->string (drop scm 1))))))) diff --git a/config-generation/sway.sld b/config-generation/sway.sld new file mode 100644 index 0000000..6956f0a --- /dev/null +++ b/config-generation/sway.sld @@ -0,0 +1,193 @@ +(define-library (config-generation sway) + (import (scheme base) + (scheme write)) + (export ;;sway-config + scm->sway-config) + (cond-expand + (guile (import (ice-9 match)))) + (cond-expand + ((not chibi) + (import (srfi 13)))) + (cond-expand + ((not guile) (import (srfi 0)))) + (begin + ;; (cond-expand + ;; (chibi + ;; (define (string-join ls . options) + ;; (let ((delimiter (if (> (length options) 0) (car options) " ")) + ;; (grammer (if (> (length options) 1) (cadr options) 'infix))) + ;; (if (pair? ls) + ;; (string-append + ;; (if (equal? grammer 'prefix) delimiter "") + ;; (car ls) + ;; (if (or (equal? grammer 'suffix) + ;; (and (equal? grammer 'infix) + ;; (pair? (cdr ls)))) + ;; delimiter + ;; "") + ;; (if (pair? (cdr ls)) + ;; (string-join (cdr ls) delimiter grammer) + ;; "")) + ;; "")))) + ;; (else)) + + ;; (define-syntax make-string-from-ellipsis + ;; (syntax-rules () + ;; ((_ text ...) + ;; (string-join (map (lambda (x) + ;; (cond + ;; ((string? x) (string-append "\"" x "\"")) + ;; ((symbol? x) (symbol->string x)) + ;; ((number? x) (number->string x)) + ;; (else x))) + ;; '(text ...)))))) + + ;; (define-syntax sway-config + ;; (syntax-rules (bindsyms bindsym set for-window) + ;; ;; Support binding group extension + ;; ((_ (bindsyms (binding ...) ...) lines ...) + ;; (string-append + ;; (sway-config (bindsym binding ...) ...) + ;; (sway-config lines) ...)) + + ;; ;; Support multi-binding extension + ;; ((_ (bindsym (shortcut ...) . action) lines ...) + ;; (string-append + ;; (sway-config (bindsym shortcut . action) ...) + ;; (sway-config lines) ...)) + ;; ((_ (bindsym shortcut (actions ...) ...) lines ...) + ;; (string-append + ;; "bindsym " (symbol->string 'shortcut) " " + ;; (string-join + ;; (map + ;; (lambda (ls) + ;; (string-join + ;; (map + ;; (lambda (x) + ;; (cond + ;; ((symbol? x) (symbol->string x)) + ;; ((number? x) (number->string x)) + ;; (else x))) + ;; ls))) + ;; '((actions ...) ...)) + ;; "; ") + ;; "\n" + ;; (sway-config lines) ...)) + ;; ((_ (bindsym shortcut action ...) lines ...) + ;; (string-append + ;; "bindsym " (make-string-from-ellipsis shortcut action ...) "\n" + ;; (sway-config lines) ...)) + + ;; ;; for_window support + ;; ((_ (for-window (criteria ...) command ...) lines ...) + ;; (letrec-syntax ((criteria->string + ;; (syntax-rules ::: () + ;; ((_ attribute value rest :::) + ;; (string-append " ["(symbol->string 'attribute) "=" "\"" value "\"] " (criteria->string rest :::))) + ;; ((_) "")))) + ;; (string-append + ;; "for_window" (criteria->string criteria ...) (make-string-from-ellipsis command ...) "\n" + ;; (sway-config lines) ...))) + + ;; ;; Support blocks (such as for mode definitions like resize mode) + ;; ((_ (block-start ... (block-body ...))) + ;; (string-append + ;; (make-string-from-ellipsis block-start ...) " {\n" + ;; (sway-config block-body ...) + ;; "}\n")) + + ;; ;; set block + ;; ((_ (set variables ...) lines ...) + ;; (letrec-syntax ((aux (syntax-rules () + ;; ((_ var val . rest) + ;; (string-append + ;; "set " (make-string-from-ellipsis var val) "\n" + ;; (aux . rest))) + ;; ((_) "")))) + ;; (string-append (aux variables ...) + ;; (sway-config lines ...)))) + + ;; ;; Default parsing + ;; ((_ (line ...)) + ;; (string-append (make-string-from-ellipsis line ...) "\n")) + ;; ((_ line lines ...) + ;; (string-append + ;; (sway-config line) + ;; (sway-config lines ...))))) + + (define (scm->sway-config scm) + (define (ensure-string s) + (cond + ((string? s) (string-append "\"" s "\"")) + ((symbol? s) (symbol->string s)) + ((number? s) (number->string s)))) + + (define (plist->list-of-lists pl) + (if (null? pl) + '() + (cons (list (car pl) (cadr pl)) + (plist->list-of-lists (cddr pl))))) + + (match scm + ;; Base case + (() "") + ;; Support binding group extension + ((('bindsyms (bindings ...) ...) . lines) + (string-append + (scm->sway-config (map (lambda (b) (cons 'bindsym b)) bindings)) + (scm->sway-config lines))) + ;; Support multi-binding extension + ((('bindsym (shortcuts ...) action ...) . lines) + (string-append + (apply string-append + (map (lambda (s) + (string-append "bindsym " + (ensure-string s) + " " + (string-join (map ensure-string action)) + "\n")) + shortcuts)) + (scm->sway-config lines))) + ;; Support bindings with multiple actions (not an extension) + ((('bindsym shortcut (actions ...) ...) . lines) + (string-append + "bindsym " (ensure-string shortcut) " " + (string-join + (map + (lambda (ls) + (string-join (map ensure-string ls))) + actions) + "; ") + "\n" + (scm->sway-config lines))) + ;; for_window support + ((('for-window (criteria ...) command ...) . lines) + (let ((criteria->string + (lambda (c) + (string-append " [" (ensure-string (car c)) "=" (ensure-string (cadr c)) "] " )))) + (string-append + "for_window" + (criteria->string criteria) + (string-join (map ensure-string command)) + "\n" + (scm->sway-config lines)))) + ;; Support blocks (such as for mode definitions like resize mode) + (((block-start ... (block-body ...)) . lines) + (string-append + (string-join (map ensure-string block-start)) " {\n" + (scm->sway-config block-body) + "}\n" + (scm->sway-config lines))) + ;; set block + ((('set . variables) . lines) + (apply string-append + (append + (map (lambda (v) (string-join (list "set" (scm->sway-config (list v))))) + (plist->list-of-lists variables)) + (list (scm->sway-config lines))))) + ;; Default parsing + ((line . lines) + (string-append + (string-join (map ensure-string line)) + "\n" + (scm->sway-config lines))))))) diff --git a/home.bash_profile b/home.bash_profile new file mode 100644 index 0000000..0b8c92d --- /dev/null +++ b/home.bash_profile @@ -0,0 +1,17 @@ +# Set up Guix Home profile +if [ -f ~/.profile ]; then . ~/.profile; fi + +# Honor per-interactive-shell startup file +if [ -f ~/.bashrc ]; then . ~/.bashrc; fi + +# Merge search-paths from multiple profiles, the order matters. +eval "$(guix package --search-paths \ +-p $HOME/.config/guix/current \ +-p $HOME/.guix-home/profile \ +-p $HOME/.guix-profile \ +-p /run/current-system/profile)" + +# Prepend setuid programs. +export PATH=/run/setuid-programs:$PATH + +# User specific environment and startup programs diff --git a/home.bashrc b/home.bashrc new file mode 100644 index 0000000..a7b79ab --- /dev/null +++ b/home.bashrc @@ -0,0 +1,42 @@ +# Bash initialization for interactive non-login shells and +# for remote shells (info "(bash) Bash Startup Files"). + +# Export 'SHELL' to child processes. Programs such as 'screen' +# honor it and otherwise use /bin/sh. +export SHELL + +if [[ $- != *i* ]] +then + # We are being invoked from a non-interactive shell. If this + # is an SSH session (as in "ssh host command"), source + # /etc/profile so we get PATH and other essential variables. + [[ -n "$SSH_CLIENT" ]] && source /etc/profile + + # Don't do anything else. + return +fi + +# Source the system-wide file. +source /etc/bashrc + +# Adjust the prompt depending on whether we're in 'guix environment'. +if [ -n "$GUIX_ENVIRONMENT" ] +then + PS1='\u@\h \w [env]\$ ' +else + PS1='\u@\h \w\$ ' +fi +alias ls='ls -p --color=auto' +alias ll='ls -l' +alias grep='grep --color=auto' +alias ip='ip -color=auto' +alias kubectl="minikube kubectl --" +alias duckdb='env LD_LIBRARY_PATH=/home/robby/.guix-profile/lib:$LD_LIBRARY_PATH $HOME/.local/bin/duckdb' + +export BUN_INSTALL="$HOME/.bun" +export PATH=$BUN_INSTALL/bin:$PATH +export PATH=/home/robby/.local/bin:/home/robby/.cargo/bin:/home/robby/.vnode/bin:$PATH +source <(jj util completion bash) +source <(nsc completion bash) + +alias nats='LD_LIBRARY_PATH="/gnu/store/9p1z62lff9czkr95n3sal97rjw5lm7wl-gcc-toolchain-14.2.0/lib:$LD_LIBRARY_PATH" nats' diff --git a/home.scm b/home.scm new file mode 100644 index 0000000..ecac3ec --- /dev/null +++ b/home.scm @@ -0,0 +1,1142 @@ +;; This "home-environment" file can be passed to 'guix home reconfigure' +;; to reproduce the content of your profile. This is "symbolic": it only +;; specifies package names. To reproduce the exact same profile, you also +;; need to capture the channels being used, as returned by "guix describe". +;; See the "Replicating Guix" section in the manual. + +;;; Good reference +;;; https://git.sr.ht/~efraim/guix-config/tree/9009e110e16a8f153add7fb4d7f1512f6a543802/item/efraim-home.scm + +(install-r7rs!) +(add-to-load-path (dirname (current-filename))) + +(import (gnu home) + (gnu home services) + (gnu home services desktop) + (gnu home services guix) + (gnu home services shells) + (gnu home services shepherd) + (gnu home services sound) + (gnu home services ssh) + (gnu home services symlink-manager) + (gnu packages) + (gnu services) + + ;(gnu services syncthing) + + (guix packages) + (gnu packages music) + (gnu packages guile-xyz) + + (guix channels) + (guix derivations) + (guix monads) + (guix modules) + (guix store) + (guix gexp) + (guix transformations) + + (srfi 1) + + (config-generation sexp) + (config-generation sway) + + (ini)) + +(define secrets (load "secrets.scm")) + +(define rz/terminal-emulator "foot") + +;; (load "./gptel.scm") + +(define home-packages + (append + (specifications->packages + (list + ;; essential + "adb" + "bind:utils" + "emacs" + "emacs-bluetooth" + "emacs-ellama" + "emacs-elpher" + "emacs-emms" + "emacs-f" + "emacs-go-mode" + "emacs-guix" + "emacs-jabber" + "emacs-markdown-mode" + "emacs-nord-theme" + "emacs-nov-el" + ;; "emacs-org" + "emacs-org-download" + "emacs-org-emms" + "emacs-org-mime" + "emacs-org-pandoc-import" + "emacs-org-roam" + "emacs-org-transclusion" + "emacs-pdf-tools" + "emacs-persist" + "emacs-pinentry" + "emacs-request" + "emacs-restclient" + "emacs-simple-httpd" + "emacs-sqlite3-api" + "emacs-toc-org" + "emacs-tramp" + "emacs-typescript-mode" + "emacs-websocket" + "emacs-which-key" + "emacs-wttrin" + "emacs-yaml-mode" + "emacs-zig-mode" + "fd" + ;; "ffmpeg" + "file" + "flatpak" + "font-fira-mono" + "font-google-noto-emoji" + ;; "gajim" + "gammastep" + "ghc-tldr" + "git" + "git:send-email" + "grim" + "gst-libav" + "gst-plugins-bad" + "gst-plugins-base" + "gst-plugins-good" + "gst-plugins-ugly" + "guile" + "htop" + "imv" + "keepassxc" + ;; "libcamera" + "libreoffice" + "mumble" + "ncurses" + "neofetch" + "nmap" + "noisetorch" + "pinentry" + "rlwrap" + "rsync" + "screen" + "sicp" + "slurp" + "sshfs" + "strace" + "syncthing" + "tesseract-ocr" + "tree" + "unzip" + "waypipe" + "wl-clipboard" + "wofi" + "xdg-user-dirs" + ;; "xsane" + "zbar" + "zip" + rz/terminal-emulator + + ;; sound + "pamixer" + "patchage" + "pulsemixer" + + ;; web + "curl" + ;; "icecat" + ;; "nyxt" + ;; "ungoogled-chromium" + + ;; games + "protonup-ng" + "steam" + + "crispy-doom" + "freedoom" + + "luanti" + ;; "minetest-worldedit" + "luanti-mineclone" + + ;; "openmw" + + "emacs-2048-game" + + ;; email + "isync" + "mb2md" + "mu" + + ;; RSS + "emacs-elfeed" + "emacs-elfeed-org" + + ;; media + "cava" + "cmus" + "mpv" + "pipe-viewer" + + ;; torrent + "emacs-transmission" + "transmission" + + ;; programming + "chibi-scheme" + ;; "emacs-cape" + ;; "emacs-corfu" + "emacs-dumb-jump" + "emacs-geiser" + "emacs-geiser-guile" + "emacs-lsp-mode" + "emacs-lsp-ui" + "emacs-origami" + "emacs-racket-mode" + "emacs-slime" + "gcc-toolchain" + "go" + "guile-ini" + "guile-lib" + "jq" + "libserialport" + ;; "mit-scheme" + ;; "node" + "racket" + "sbcl" + ;; "snd" + "zig" + + ;; education + ;; "stellarium" + + ;; photography + "darktable" + "gimp" + ;; "krita" + + ;; recording + "obs" + "obs-wlrobs" + "obs-vkcapture" + ;; "kdenlive" + + ;; modeling + "libfive" + + ;; Editing + "emacs-emojify" + "emacs-org-bullets" + "emacs-ox-hugo" + "ispell")) + ;; Extra package definitions + (list + ;; ((options->transformation '((with-commit . "guile-next=f3ea8f7fa1d84a559c7bf834fe5b675abe0ae7b8"))) + ;; (specification->package "guile-next")) + ;; ((options->transformation '((with-commit . "chibi-scheme=29dd1a3b81e297033f687cbbf2b51319856647f4"))) + ;; (specification->package "chibi-scheme")) + ;; emacs-gptel + ))) + + +(define emacs-config + (string-append + ";; See /home/robby/.config/guix-home/home-configuration.scm\n" + (scm->string + ;; Load the secrets file + `((when (not (load "/home/robby/.config/emacs/secrets.el")) + (message "could not load secrets!")) + + ;; Load the Nord theme when launching an emacsclient GUI + (if (daemonp) + (add-hook 'after-make-frame-functions + (lambda (frame) + (with-selected-frame + frame + (load-theme 'nord t)))) + (load-theme 'nord t)) + + ;; Safe variables + (custom-set-variables + ;; custom-set-variables was added by Custom. + ;; 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. + '(safe-local-variable-values + '((auto-save-default) + (org-download-image-dir . "~/org/pictures") + (eval progn + (require 'lisp-mode) + (defun emacs27-lisp-fill-paragraph + (&optional justify) + (interactive "P") + (or + (fill-comment-paragraph justify) + (let + ((paragraph-start + (concat paragraph-start "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)")) + (paragraph-separate + (concat paragraph-separate "\\|\\s-*\".*[,\\.]$")) + (fill-column + (if + (and + (integerp emacs-lisp-docstring-fill-column) + (derived-mode-p 'emacs-lisp-mode)) + emacs-lisp-docstring-fill-column fill-column))) + (fill-paragraph justify)) + t)) + (setq-local fill-paragraph-function + (syntax emacs27-lisp-fill-paragraph))) + (eval modify-syntax-entry 43 "'") + (eval modify-syntax-entry 36 "'") + (eval modify-syntax-entry 126 "'") + (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 + (syntax 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")))) + + ;; Do not open windows in the same Emacs frame. + ;; (setq pop-up-frames 'graphic-only) + + (setq inferior-lisp-program "/home/robby/.guix-home/profile/bin/sbcl") + + ;; Enable which-key mode + (which-key-mode) + + ;; Automatically create closing pairs + (electric-pair-mode 1) + + ;; Show matching parenthesis + (show-paren-mode 1) + (setq show-paren-delay 0) + + ;; Hide the tool bar + (tool-bar-mode -1) + + ;; Hide the menu bar + (menu-bar-mode -1) + + ;; Hide the scroll bar + (scroll-bar-mode -1) + + ;; Highlight the current line + (global-hl-line-mode 1) + + ;; Enable line numbers + (global-display-line-numbers-mode) + (setq display-line-numbers-type 'relative) + + ;; Disable line numbers for certain modes + (add-hook 'eshell-mode-hook (lambda () (display-line-numbers-mode -1))) + + ;; Show the column number + (setq column-number-mode t) + + ;; Add e as an alias for find-file. Useful for eshell. + (defalias 'e (function find-file)) + + ;; Eshell visual commands + (setq eshell-visual-subcommands '(("guix" "search") + ("pipe-viewer") + ("keepassxc-cli" "open"))) + + ;; Open init file + (defun open-init-file () + "Open the init file." + (interactive) + (find-file "~/.config/guix-home/home-configuration.scm")) + + (global-set-key (kbd "C-x i") 'open-init-file) + + ;; Function to create a new eshell. Used for Sway binding. + (defvar next-eshell -1) + (defun new-eshell () + (setq next-eshell (+ 1 next-eshell)) + (eshell next-eshell)) + + ;; Power + (defun eshell/poweroff () + "Shutdown the computer." + (call-process "loginctl" null-device nil nil "poweroff")) + + (defun eshell/reboot () + "Reboot the computer." + (call-process "loginctl" null-device nil nil "reboot")) + + ;; For using tramp guix->guix + (require 'tramp) + ;; (setq tramp-remote-path + ;; (append tramp-remote-path + ;; '(tramp-own-remote-path))) + + ;; Scheme extra file extensions + (setq auto-mode-alist (append '(("\\.sld\\'" . scheme-mode)) auto-mode-alist)) + + ;; Code folding + ;; (require 'origami) + ;; Add mode hooks + ;; (dolist (mode '(nxml-mode-hook csharp-mode-hook c-mode-hook scheme-mode-hook emacs-lisp-mode-hook)) + ;; (add-hook mode 'origami-mode)) + ;; Specify extra parsers + ;; (dolist (parser-pair '((scheme-mode . origami-elisp-parser) (csharp-mode . origami-c-style-parser))) + ;; (add-to-list 'origami-parser-alist parser-pair)) + ;; (define-key origami-mode-map (kbd "<C-tab>") 'origami-recursively-toggle-node) + + ;;; Org mode config + (require 'org-download) + (setq org-startup-with-inline-images t) + (add-hook 'org-mode-hook 'org-indent-mode) + (add-hook 'org-mode-hook 'toc-org-mode) + + ;; Org bullets + (require 'org-bullets) + (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) + + ;; Org babel language support + (org-babel-do-load-languages + 'org-babel-load-languages + '((emacs-lisp . t) + (eshell . t) + (C . t) + (scheme . t))) + + ;; Org link abbreviations + (setq org-link-abbrev-alist + '(("wikipedia" . "https://en.wikipedia.org/wiki/") + ("wiki" . "https://wiki.zambito.xyz/index.php?title=") + ("gh" . "https://github.com/") + ("guix" . "elisp:(guix-packages-by-name \"%s\")") + ("isbn" . "https://www.bookfinder.com/isbn/") + ("man" . "elisp:(man \"%s\")"))) + + ;; Org roam + (require 'org-roam) + (setq org-roam-directory "~/org" + org-roam-capture-templates '(("d" "default" plain + "%?" + :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") + :unnarrowed t) + ("p" "person" plain + (file "~/org/templates/person.org") + :target (file "%<%Y%m%d%H%M%S>-${slug}.org") + :unnarrowed t) + ("b" "book" plain + (file "~/org/templates/book.org") + :target (file "%<%Y%m%d%H%M%S>-${slug}.org") + :unnarrowed t)) + org-roam-dailies-capture-templates '(("d" "default" entry "* %?" + :target (file+head "%<%Y-%m-%d>.org" + "#+title: %<%Y-%m-%d>\n")) + ("v" "Value" entry "* %?" + :target (file+head+olp "%<%Y-%m-%d>.org" + "#+title: %<%Y-%m-%d>\n" + ("What do I value?"))) + ("t" "Trajectory" entry "* %?" + :target (file+head+olp "%<%Y-%m-%d>.org" + "#+title: %<%Y-%m-%d>\n" + ("What is my trajectory today?"))))) + (add-to-list 'org-roam-file-exclude-regexp "par/") + (org-roam-db-autosync-enable) + (global-set-key (kbd "C-c n i") 'org-roam-node-insert) + (global-set-key (kbd "C-c n f") 'org-roam-node-find) + (global-set-key (kbd "C-c n r") 'org-roam-node-random) + (global-set-key (kbd "C-c n t") 'org-roam-buffer-toggle) + (global-set-key (kbd "C-c d c t") 'org-roam-dailies-capture-today) + (global-set-key (kbd "C-c d c n") 'org-roam-dailies-capture-tomorrow) + (global-set-key (kbd "C-c d c p") 'org-roam-dailies-capture-yesterday) + (global-set-key (kbd "C-c d c d") 'org-roam-dailies-capture-date) + (global-set-key (kbd "C-c d f t") 'org-roam-dailies-goto-today) + (global-set-key (kbd "C-c d f n") 'org-roam-dailies-goto-next-note) + (global-set-key (kbd "C-c d f p") 'org-roam-dailies-goto-previous-note) + (global-set-key (kbd "C-c d f d") 'org-roam-dailies-goto-date) + + (add-to-list 'load-path "~/src/org-roam-ui/") + (require 'org-roam-ui) + (setq org-roam-ui-sync-theme t + org-roam-ui-follow t + org-roam-ui-update-on-save t + org-roam-ui-open-on-start nil) + (org-roam-ui-mode 1) + + ;; Emojify + (global-emojify-mode 1) + + ;; ERC + ;; See: https://gist.github.com/chumpage/1243771 + (require 'erc-services) + (erc-services-mode 1) + + (setq erc-server "irc.libera.chat" + erc-nick "Zambyte" + erc-port 6697 + erc-prompt-for-nickserv-passwork nil + erc-prompt-for-passwork t + erc-nickserv-passwords (list (list 'Libera.Chat (list (cons "Zambyte" (cdr (assoc 'libera secrets)))))) + erc-autojoin-channels-alist '((Libera.Chat "#archlinux" + "#c" + "#emacs" + "#fsf" + "#gnu" + "#guile" + "#guix" + "#hurd" + "#lisp" + "#mastodon" + "#pleroma" + "#pleroma-dev" + "#scheme" + "#sway" + "#minetest" + "#lojban" + "#ckule" + "#jbosnu" + "#proga" + "#lowellmakes"))) + + ;; Email + (require 'mu4e) + (setq mu4e-get-mail-command "SSL_CERT_DIR=/home/robby/.guix-profile/etc/ssl/certs mbsync personal") + (setq user-full-name "Robby Zambito" + user-mail-address "contact@robbyzambito.me" + send-mail-function (function smtpmail-send-it) + smtpmail-smtp-server "mail.gandi.net" + smtpmail-stream-type 'starttls + smtpmail-smtp-service 587) + (global-set-key (kbd "C-x C-m") 'mu4e) + + ;; Music + (emms-all) + (setq emms-player-list '(emms-player-mpv) + emms-info-functions '(emms-info-native) + ;; emms-player-mpv-parameters '("--ao=pipewire") + ) + + ;; RSS + (require 'elfeed) + (require 'elfeed-show) + (require 'elfeed-org) + (elfeed-org) + (setq rmh-elfeed-org-files (list "~/org/20230517231456-elfeed.org") + elfeed-search-filter "@6-months-ago +unread -reddit -hn -politics") + + ;; TODO: this doesn't work + (add-hook 'elfeed-mode-hook + (lambda () + (define-key elfeed-mode-map "\\C-c\\C-u" + 'elfeed-update))) + + ;; Source https://github.com/skeeto/elfeed/issues/267 + (defun elfeed-play-with-mpv () + "Play entry link with mpv." + (interactive) + (let ((entry (if (eq major-mode 'elfeed-show-mode) elfeed-show-entry (elfeed-search-selected :single))) + (quality-arg "") + (quality-val (completing-read "Max height resolution (0 for unlimited): " '("0" "480" "720") nil nil))) + (setq quality-val (string-to-number quality-val)) + (message "Opening %s with heightâÃÂä%s with mpv..." (elfeed-entry-link entry) quality-val) + (when (< 0 quality-val) + (setq quality-arg (format "--ytdl-format=[height<=?%s]" quality-val))) + (start-process "elfeed-mpv" nil "mpv" quality-arg (elfeed-entry-link entry)))) + + (defun elfeed-open-with-eww () + "Open in eww with `eww-readable'." + (interactive) + (let ((entry (if (eq major-mode 'elfeed-show-mode) elfeed-show-entry (elfeed-search-selected :single)))) + (eww (elfeed-entry-link entry)) + (add-hook 'eww-after-render-hook 'eww-readable nil t))) + + (defvar elfeed-visit-patterns + '(("youtu\\.?be" . elfeed-play-with-mpv) + ("v\\.redd\\.it" . elfeed-play-with-mpv) + ("reddit" . elfeed-play-with-mpv) + ("phoronix" . elfeed-open-with-eww) + ("jcs\\.org" . elfeed-play-with-mpv)) + "List of (regexps . function) to match against elfeed entry link to know +whether how to visit the link.") + + (defun elfeed-visit-maybe-external () + "Visit with external function if entry link matches `elfeed-visit-patterns', +visit otherwise." + (interactive) + (let ((entry (if (eq major-mode 'elfeed-show-mode) + elfeed-show-entry + (elfeed-search-selected :single))) + (patterns elfeed-visit-patterns)) + (while (and patterns (not (string-match (caar patterns) (elfeed-entry-link entry)))) + (setq patterns (cdr patterns))) + (cond + (patterns + (elfeed-untag entry 'unread) + (elfeed-search-update-entry entry) + (funcall (cdar patterns))) + ((eq major-mode 'elfeed-search-mode) + (call-interactively 'elfeed-search-show-entry)) + (t (elfeed-show-visit))))) + + ;; https://github.com/skeeto/elfeed/issues/317 and + ;; https://github.com/skeeto/elfeed/pull/448#issuecomment-1120336279 + ;; Speeds up getting elfeed feeds + (setq flycheck-global-modes '(not . (elfeed-search-mode))) + + (define-key elfeed-show-mode-map (kbd "<C-return>") 'elfeed-visit-maybe-external) + (define-key elfeed-search-mode-map (kbd "<C-return>") 'elfeed-visit-maybe-external) + (global-set-key (kbd "C-x w") 'elfeed) + + ;; Pleroma + (add-to-list 'load-path "/home/robby/src/mastodon.el/lisp/") + (require 'mastodon) + (setq mastodon-instance-url "https://zoinks.one" + mastodon-active-user "robby") + + ;; Programming + + ;; https://www.youtube.com/watch?v=Vx0bSKF4y78 + ;; https://github.com/minad/corfu + ;; (require 'corfu) + ;; (setq corfu-cycle t + ;; corfu-auto t + ;; corfu-auto-delay 0 + ;; corfu-quit-no-match 'separator + ;; corfu-echo-documentation 0.25 + ;; corfu-preselect-first nil) + ;; (global-corfu-mode) + ;; (corfu-history-mode) + + ;; ;; https://github.com/minad/cape + ;; (require 'cape) + ;; (add-to-list 'completion-at-point-functions (function cape-dabbrev)) + ;; (add-to-list 'completion-at-point-functions (function cape-file)) + + ;; (("C-c p p" . completion-at-point) ;; capf + ;; ("C-c p t" . complete-tag) ;; etags + ;; ("C-c p d" . cape-dabbrev) ;; or dabbrev-completion + ;; ("C-c p h" . cape-history) + ;; ("C-c p f" . cape-file) + ;; ("C-c p k" . cape-keyword) + ;; ("C-c p s" . cape-symbol) + ;; ("C-c p a" . cape-abbrev) + ;; ("C-c p i" . cape-ispell) + ;; ("C-c p l" . cape-line) + ;; ("C-c p w" . cape-dict) + ;; ("C-c p \\" . cape-tex) + ;; ("C-c p _" . cape-tex) + ;; ("C-c p ^" . cape-tex) + ;; ("C-c p &" . cape-sgml) + ;; ("C-c p r" . cape-rfc1345)) + + ;; (require 'gptel) + ;; (setq gptel-default-mode 'org-mode) + ;; (setq gptel-default-mode 'text-mode) ; I cannot use org-mode, as there is a bug: https://github.com/karthink/gptel/issues/81 + ;; (define-key gptel-mode-map (kbd "C-c RET") 'gptel-send) + ;; (define-key gptel-mode-map (kbd "C-c C-<return>") 'gptel-send) + ;; (define-key gptel-mode-map (kbd "C-c C-m") 'gptel-menu) + + )))) + +(define screenshot-menu "guile --r7rs -L ~/src/wofi-guile/lib/ ~/src/screenshot-menu.scm") + +(define rz/sway-config + (scm->sway-config + ;;; Variables + `((set $mod Mod4 ; Logo key. Use Mod1 for Alt. + $hyper Mod1+Mod4+Shift+Control + $meh Mod1+Shift+Control + + ;; Home row directions keys, like vim. + $left h + $down j + $up k + $right l + + ;; Prefered terminal emulator + $term ,rz/terminal-emulator + + ;; Preferred editor + $editor "emacsclient -c -a emacs" + + ;; Preferred application launcher + $menu "wofi -c ~/.config/wofi/config -I" + + ;; Preferred music player + $music ,(string-append rz/terminal-emulator " cmus")) + + + ;; Output configuration + (output ((* bg "#2E3440" solid_color) + (HDMI-A-1 mode 1920x1080@144Hz))) + + ;; Input configuration + ;; (input "9580:110:HUION_Huion_Tablet_Pen" map_to_output HDMI-A-1) + + ;; Hide cursor after 3 seconds + (seat * hide_cursor 3000) + + (input "1133:50504:Logitech_USB_Receiver_Mouse" + ((accel_profile flat) + (pointer_accel -0.4))) + +;;; Key bindings + (bindsyms + ;; Kill focused window + (($mod+Shift+q $meh+q) kill) + ;; Start launcher + (($hyper+d $mod+d) exec $menu) + ;; Reload the config file + ($mod+Shift+c reload) + ;; Lock sway + (($meh+l $mod+Semicolon) exec swaylock -c "#000000") + ;; Exit sway + ($mod+Shift+e exec swaynag -t warning -m "You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session." -b "Yes, exit sway" "herd stop sway") + ;; Screenshot menu + ($meh+a exec ,screenshot-menu)) + + ;; Drag floating windows by holding down $mod and left mouse button. + ;; Resize them with right mouse button + $mod. + ;; Also works for non-floating windows. + ;; Change normal to inverse to use left mouse buttor for resizing and right + ;; mouse button for dragging. + (floating_modifier $mod normal) + + ;; Moving around + (bindsyms + ;; Moving focus around + (($mod+$left $mod+Left) focus left) + (($mod+$down $mod+Down) focus down) + (($mod+$up $mod+Up) focus up) + (($mod+$right $mod+Right) focus right) + + ;; Move the focused window by adding Shift + (($mod+Shift+$left $mod+Shift+Left) move left) + (($mod+Shift+$down $mod+Shift+Down) move down) + (($mod+Shift+$up $mod+Shift+Up) move up) + (($mod+Shift+$right $mod+Shift+Right) move right)) + + ;; Workspaces + (bindsyms + ;; Switch to workspace + ($mod+1 workspace number 1) + ($mod+2 workspace number 2) + ($mod+3 workspace number 3) + ($mod+4 workspace number 4) + ($mod+5 workspace number 5) + ($mod+6 workspace number 6) + ($mod+7 workspace number 7) + ($mod+8 workspace number 8) + ($mod+9 workspace number 9) + ($mod+0 workspace number 10) + + ;; Move focused container to workspace + ($mod+Shift+1 move container to workspace number 1) + ($mod+Shift+2 move container to workspace number 2) + ($mod+Shift+3 move container to workspace number 3) + ($mod+Shift+4 move container to workspace number 4) + ($mod+Shift+5 move container to workspace number 5) + ($mod+Shift+6 move container to workspace number 6) + ($mod+Shift+7 move container to workspace number 7) + ($mod+Shift+8 move container to workspace number 8) + ($mod+Shift+9 move container to workspace number 9) + ($mod+Shift+0 move container to workspace number 10) + + ;; Split the current object + ($mod+b splith) + ($mod+v splitv) + + ;; Switch the current container layout style + ($mod+s layout stacking) + ($mod+w layout tabbed) + ($mod+e layout toggle split) + + ;; Make the current focus fullscreen + ($mod+f fullscreen) + + ;; Toggle focus between tiling and floating mode + ($mod+Shift+space floating toggle) + + ;; Swap focus between the tiling area and the floating area + ($mod+space focus mode_toggle) + + ;; Move focus to the parent container + ($mod+a focus parent)) + + ;;; Scratchpad + (bindsyms + ;; Move the currently focused window to the scratchpad + ($mod+Shift+minus move scratchpad) + ;; Show the next scratchpad window or hide the focused scratchpad window. + ;; If there are multiple scratchpad windows, this command cycles through them. + ($mod+minus scratchpad show)) + + ;;; Resizing + (mode "resize" + ((bindsyms + (($left Left) resize shrink width 10px) + (($down Down) resize grow height 10px) + (($up Up) resize shrink height 10px) + (($right Right) resize grow width 10px) + + ;; Return to default mode + (Return mode "default") + (Escape mode "default")))) + (bindsym $mod+r mode "resize") + + ;;; Media + (bindsyms + (XF86AudioRaiseVolume exec pamixer --increase 5) + (XF86AudioLowerVolume exec pamixer --decrease 5) + (XF86AudioMute exec pamixer --toggle-mute) + (XF86AudioPlay exec emacsclient -e "(emms-pause)") + (XF86AudioNext exec emacsclient -e "(emms-next)") + (XF86AudioPrev exec emacsclient -e "(emms-previous)") + (XF86Search exec $menu)) + + ;; Applications + (bindsyms + ;; Start music player on workspace 5 + ($hyper+m (workspace 5) (exec $music) (workspace back_and_forth)) + ;; Start terminal + (($mod+Return $mod+Shift+t) exec emacsclient -c -e "(new-eshell)") + ;; Start editor + (($mod+t $hyper+t) exec $editor)) + + (exec "hash dbus-update-activation-environment 2>/dev/null") + (exec "dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP") + + ;;; Styling + + (font "pango:Noto Sans Mono" 8) + (titlebar_padding 7 1) + + ;; Remove titlebar by default + (for-window (title ".*") border pixel 2) + + ;; Class border backgr. text indicator child_border + (client.focused "#bf616a" "#bf616a" "#ffffff" "#bf616a" "#bf616a") + (client.focused_inactive "#333333" "#5f676a" "#ffffff" "#484e50" "#5f676a") + (client.unfocused "#333333" "#222222" "#888888" "#292d2e" "#222222") + (client.urgent "#2f343a" "#900000" "#ffffff" "#900000" "#900000") + (client.placeholder "#000000" "#0c0c0c" "#ffffff" "#000000" "#0c0c0c")))) + +(define foot-config + (with-output-to-string + (lambda () + (scm->ini + '((#f + ("font" . "monospace:size=12")) + + ;; Nord theme + (colors + ("background" . "2e3440") + ("foreground" . "d8dee9") + ("cursor" . "2e3440 d8dee9") + + ("regular0" . "3b4252") + ("regular1" . "bf616a") + ("regular2" . "a3be8c") + ("regular3" . "ebcb8b") + ("regular4" . "81a1c1") + ("regular5" . "b48ead") + ("regular6" . "88c0d0") + ("regular7" . "e5e9f0") + + ("bright0" . "4c566a") + ("bright1" . "bf616a") + ("bright2" . "a3be8c") + ("bright3" . "ebcb8b") + ("bright4" . "81a1c1") + ("bright5" . "b48ead") + ("bright6" . "8fbcbb") + ("bright7" . "eceff4") + + ("dim0" . "373e4d") + ("dim1" . "94545d") + ("dim2" . "809575") + ("dim3" . "b29e75") + ("dim4" . "68809a") + ("dim5" . "8c738c") + ("dim6" . "6d96a5") + ("dim7" . "aeb3bb"))))))) + +(define wofi-config + (with-extensions + (list guile-ini guile-smc guile-lib) + #~(begin + (import (ini)) + (with-output-to-file #$output + (lambda () + (scm->ini + '((#f + ("stylesheet" . #$(local-file "wofi/style.css")) + ("xoffset" . 0) + ("yoffset" . 0) + ("hide_scroll" . "true") + ("show" . "drun") + ("width" . "600px") + ("lines" . 10) + ("line_wrap" . "word") + ("term" . #$rz/terminal-emulator) + ("allow_markup" . "true") + ("always_parse_args" . "true") + ("show_all" . "true") + ("print_command" . "true") + ("layer" . "overlay") + ("allow_images" . "true") + ("insensitivity" . "true") + ("prompt" . "Hey, you should type something!") + ("image_size" . 25) + ("display_generic" . "true") + ("key_expand" . "Tab"))))))))) + +(define git-config + (with-output-to-string + (lambda () + (scm->ini + `((init + ("defaultBranch" . "master")) + (core + ("editor" . "emacsclient -c")) + (user + ("email" . "contact@robbyzambito.me") + ("name" . "Robby Zambito")) + ;; see push.autoSetupRemote in git help config + (push + ("autoSetupRemote" . "true")) + ("url \"rad://\"" + ("insteadOf" . "https://rad.go/"))))))) + +(define guix-gaming-config (cdr (assq 'guix-gaming-config secrets))) + +(define rz/user-dirs + (string-append "XDG_DESKTOP_DIR=\"$HOME/desktop\"\n" + "XDG_DOWNLOAD_DIR=\"$HOME/downloads\"\n" + "XDG_TEMPLATES_DIR=\"$HOME/templates\"\n" + "XDG_PUBLICSHARE_DIR=\"$HOME/public\"\n" + "XDG_DOCUMENTS_DIR=\"$HOME/documents\"\n" + "XDG_MUSIC_DIR=\"$HOME/music\"\n" + "XDG_PICTURES_DIR=\"$HOME/pictures\"\n" + "XDG_VIDEOS_DIR=\"$HOME/videos\"\n")) + +(define log-dir (or (getenv "XDG_LOG_HOME") "/home/robby/.local/var/log")) + +(define (generate-openssh-hosts num-vces num-vms-per-vce) + ;; Generate all VCE numbers from 1 to num-vces + (let ((vce-numbers (iota num-vces 1)) + (vm-numbers (iota num-vms-per-vce 1))) + ;; For each VCE, generate configurations for all VMs + (append-map + (lambda (vce-num) + ;; For each VM number, create a configuration + (map + (lambda (vm-num) + (openssh-host (name (string-append "rt-vce" (number->string vce-num) + "-kali" (number->string vm-num))) + (user "redteam") + (host-name (string-append "172.18.6." (number->string (+ 60 vm-num)))) + (identity-file "/home/robby/.ssh/redteam_key") + (proxy (list + (proxy-jump (host-name (string-append "vce" (number->string vce-num)))))) + (extra-content + (string-append " DynamicForward 8888\n" + " StrictHostKeyChecking no\n" + " UserKnownHostsFile=/dev/null")))) + vm-numbers)) + vce-numbers))) + +(define redteam-kali-vms (generate-openssh-hosts 2 10)) + +(home-environment + ;; Below is the list of packages that will show up in your + ;; Home profile, under ~/.guix-home/profile. + (packages home-packages) + + ;; Below is the list of Home services. To search for available + ;; services, run 'guix home search KEYWORD' in a terminal. + (services + (list (service home-bash-service-type + (home-bash-configuration + (aliases '(("grep" . "grep --color=auto") + ("ll" . "ls -l") + ("ls" . "ls -p --color=auto") + ("cp" . "cp --preserve=timestamps") + ("reboot" . "loginctl reboot") + ("poweroff" . "loginctl poweroff") + ("hibernate" . "loginctl hibernate") + ("p1" . "ping 1.1.1.1") + ("p8" . "ping 8.8.8.8"))) + (bashrc (list (local-file "home.bashrc" + "bashrc"))) + (bash-profile (list (local-file + "home.bash_profile" + "bash_profile"))))) + (service home-dbus-service-type) + (service home-xdg-configuration-files-service-type + `(("user-dirs.dirs" ,(plain-file "user-dirs" rz/user-dirs)) + ("sway/config" ,(plain-file "sway-config" rz/sway-config)) + ("emacs/init.el" ,(plain-file "init.el" emacs-config)) + ("foot/foot.ini" ,(plain-file "foot.ini" foot-config)) + ("wofi/config" ,(computed-file "wofi-config" wofi-config)) + ("git/config" ,(plain-file "git-config" git-config)) + ("guix-gaming-channels/games.scm" ,(plain-file "guix-gaming-config" guix-gaming-config)))) + (service home-files-service-type + `((".mbsyncrc" ,(local-file "mbsyncrc")) + (".nmprc" ,(plain-file "npmrc" "prefix=/home/robby/.vnode")))) + (service home-shepherd-service-type + (home-shepherd-configuration + (services + (list + (shepherd-service + (documentation "SwayWM") + (provision '(sway)) + (requirement '(dbus)) + (respawn? #f) + (auto-start? #f) + (start #~(make-forkexec-constructor + (list #$(file-append (specification->package "dbus") "/bin/dbus-run-session") "sway") + #:log-file (string-append #$log-dir "/swaywm.log"))) + (stop #~(make-system-destructor + (string-join (list #$(file-append (specification->package "sway") "/bin/swaymsg") + "exit"))))) + (shepherd-service + (documentation "Emacs Server") + (provision '(emacs)) + (start #~(make-system-constructor "emacs --daemon")) + (stop #~(make-system-destructor "emacsclient --eval \"(kill-emacs)\""))) + ;(shepherd-service + ;(documentation "Run `syncthing' without calling the browser") + ;(provision '(syncthing)) + ;(start #~(make-forkexec-constructor + ;(list #$(file-append (specification->package "syncthing") "/bin/syncthing") + ;"-no-browser") + ;#:log-file (string-append #$log-dir "/syncthing.log"))) + ;(stop #~(make-kill-destructor)) + ;(respawn? #t)) + (shepherd-service + (documentation "Run a Radicle node") + (provision '(rad)) + (start #~(make-forkexec-constructor + (list "/home/robby/.cargo/bin/rad" "node" "start" "--path" "/home/robby/.cargo/bin/radicle-node" "--foreground") + #:log-file (string-append #$log-dir "/rad-node.log"))) + (stop #~(make-system-destructor "/home/robby/.cargo/bin/rad node stop")) + (respawn? #t)) + (shepherd-service + (documentation "Run the Radicle web API") + (provision '(rad-web)) + (start #~(make-forkexec-constructor + (list "/home/robby/.cargo/bin/rad-web" "--no-open") + #:log-file (string-append #$log-dir "/rad-web.log"))) + (stop #~(make-kill-destructor)) + (respawn? #t)))))) + (service home-pipewire-service-type) + (simple-service 'some-useful-env-vars-service + home-environment-variables-service-type + `(("LESSHISTFILE" . "$XDG_CACHE_HOME/.lesshst") + ("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:/home/robby/.local/share/flatpak/exports/share") + ("EDITOR" . "emacsclient -n -a emacs") + ("EMACSLOADPATH" . "$HOME/.guix-home/profile/share/emacs/site-lisp/"))) + (service home-openssh-service-type + (home-openssh-configuration + (hosts + (append (list (openssh-host (name "not-a-pi") + (host-name "10.69.0.1")) + (openssh-host (name "zoinks") + (host-name "zoinks.one")) + (openssh-host (name "lowell-makes") + (host-name "96.81.79.90") + (port 1122)) + (openssh-host (name "lowell-makes-cameo2") + (host-name "cameo2") + (port 22) + (proxy (list + (proxy-jump (host-name "lowell-makes"))))) + (openssh-host (name "lowell-makes-cameo") + (host-name "cameo") + (port 22) + (proxy (list + (proxy-jump (host-name "lowell-makes"))))) + (openssh-host (name "lowell-makes-mogan") + (host-name "mogan") + (port 22) + (proxy (list + (proxy-jump (host-name "lowell-makes"))))) + (openssh-host (name "bustelo") + (host-name "10.5.10.187") + (port 22) + (proxy (list + (proxy-jump (host-name "lowell-makes"))))) + (openssh-host (name "moja") + (host-name "45.77.97.44")) + (openssh-host (name "babel") + (host-name "10.80.80.162")) + (openssh-host (name "alpha.apex") + (host-name "149.28.47.99")) + (openssh-host (name "vce1") + (host-name "vce1.ncaecybergames.org") + (user "rz") + (port 2210) + (extra-content + (string-append " DynamicForward 8888\n"))) + (openssh-host (name "vce2") + (host-name "vce2.ncaecybergames.org") + (user "rz") + (port 2210) + (extra-content + (string-append " DynamicForward 8888\n")))) + redteam-kali-vms)) + (authorized-keys (cdr (assq 'ssh-authorized-keys secrets))))) + (simple-service 'variant-packages-service + home-channels-service-type + (cons* + ;; (channel + ;; (name 'nonguix) + ;; (url "https://git.robbyzambito.me/mirror/nonguix.git") + ;; (branch "steam-no-pulse")) + (channel + (name 'nonguix) + (url "https://gitlab.com/nonguix/nonguix") + ;; Enable signature verification: + (introduction + (make-channel-introduction + "897c1a470da759236cc11798f4e0a5f7d4d59fbc" + (openpgp-fingerprint + "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5")))) + (channel + (name 'guix-gaming-games) + (url "https://gitlab.com/guix-gaming-channels/games.git") + ;; Enable signature verification: + (introduction + (make-channel-introduction + "c23d64f1b8cc086659f8781b27ab6c7314c5cca5" + (openpgp-fingerprint + "50F3 3E2E 5B0C 3D90 0424 ABE8 9BDC F497 A4BB CC7F")))) + (channel + (name 'guix) + (url "https://codeberg.org/guix/guix.git")) + '() + ;; %default-channels + ))))) diff --git a/reconfigure b/reconfigure new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/reconfigure diff --git a/reconfigure-home b/reconfigure-home new file mode 100755 index 0000000..81b626e --- /dev/null +++ b/reconfigure-home @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +guix home reconfigure ./home.scm
\ No newline at end of file diff --git a/reconfigure-system b/reconfigure-system new file mode 100755 index 0000000..48374bf --- /dev/null +++ b/reconfigure-system @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +sudo guix system reconfigure ./system.scm
\ No newline at end of file diff --git a/sway-config b/sway-config new file mode 100644 index 0000000..6c5c945 --- /dev/null +++ b/sway-config @@ -0,0 +1,235 @@ +# Default config for sway +# +# Copy this to ~/.config/sway/config and edit it to your liking. +# +# Read `man 5 sway` for a complete reference. + +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term alacritty +# Your preferred application launcher +# Note: pass the final command to swaymsg so that the resulting window can be opened +# on the original workspace that the command was run on. +set $menu dmenu_path | dmenu | xargs swaymsg exec -- + +### Output configuration +# +# Default wallpaper (more resolutions are available in /gnu/store/491iy1nkl4y9k73k5qlp3rjnzp60kl9i-sway-1.6.1/share/backgrounds/sway/) +# output * bg /gnu/store/491iy1nkl4y9k73k5qlp3rjnzp60kl9i-sway-1.6.1/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill + +output * bg #000D0D solid_color +output HDMI-A-1 mode 1920x1080@144Hz + +# +# Example configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs + +### Idle configuration +# +# Example configuration: +# +# exec swayidle -w \ +# timeout 300 'swaylock -f -c 000000' \ +# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ +# before-sleep 'swaylock -f -c 000000' +# +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+d exec $menu + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: +# + # Switch to workspace + bindsym $mod+1 workspace number 1 + bindsym $mod+2 workspace number 2 + bindsym $mod+3 workspace number 3 + bindsym $mod+4 workspace number 4 + bindsym $mod+5 workspace number 5 + bindsym $mod+6 workspace number 6 + bindsym $mod+7 workspace number 7 + bindsym $mod+8 workspace number 8 + bindsym $mod+9 workspace number 9 + bindsym $mod+0 workspace number 10 + # Move focused container to workspace + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + bindsym $mod+Shift+0 move container to workspace number 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +# +# Media keys: +# +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle +bindsym XF86MonBrightnessDown exec brightnessctl set 5%- +bindsym XF86MonBrightnessUp exec brightnessctl set 5%+ +bindsym XF86AudioPlay exec playerctl play-pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous +bindsym XF86Search exec $menu + +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +bar { + position top + + # When the status_command prints a new line to stdout, swaybar updates. + # The default just shows the current date and time. + status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done + + colors { + statusline #ffffff + background #323232 + inactive_workspace #32323200 #32323200 #5c5c5c + } +} + +include /gnu/store/491iy1nkl4y9k73k5qlp3rjnzp60kl9i-sway-1.6.1/etc/sway/config.d/* diff --git a/system.scm b/system.scm new file mode 100644 index 0000000..b59b150 --- /dev/null +++ b/system.scm @@ -0,0 +1,254 @@ +;; This is an operating system configuration generated +;; by the graphical installer. +;; +;; Once installation is complete, you can learn and modify +;; this file to tweak the system configuration, and pass it +;; to the 'guix system reconfigure' command to effect your +;; changes. + + +;; Indicate which modules to import to access the variables +;; used in this configuration. +(use-modules (gnu) + (gnu system setuid)) + +(use-service-modules avahi + cups + dbus + desktop + docker + linux ; for kernel-module-loader-service-type + messaging + networking + sound + spice + ssh + virtualization + xorg) + +(use-package-modules games ;for steam-devices-udev-rules + gnome ;for libratbag + linux ;for v4l2loopback-linux-module + messaging ;for bitlbee and bitlbee plugins + pulseaudio) + +(use-modules (nongnu packages linux) + (nongnu system linux-initrd)) + +(import (srfi 1) + (guix channels) + (guix inferior)) + +(define-values (rz/linux rz/linux-libre-headers rz/linux-kernel-modules) + (let* ((channels + (list (channel + (name 'nonguix) + (url "https://gitlab.com/nonguix/nonguix") + (commit "440720b7b2ca4789298f3150bc82bf1b5ed4b8c9")) + (channel + (name 'guix) + (url "https://git.savannah.gnu.org/git/guix.git") + (commit "d37b467631d5b0e965ea933b8bda8448993580e9")))) + (inferior (inferior-for-channels channels)) + (kernel-version "6.2.2")) + (values (specification->package "linux") + (first (lookup-inferior-packages inferior "linux-libre-headers")) + ;; TODO FIX + (list (specification->package "v4l2loopback-linux-module") + )))) + +;; TODO FIX +;; (define dslr-webcam-config +;; (plain-file "dslr-webcam.conf" +;; (string-append +;; "alias dslr-webcam v4l2loopback\n" +;; "options v4l2loopback exclusive_caps=1 max_buffers=2 devices=2 video_nr=2,3"))) + + +;; (define scarlett-config +;; (plain-file "snd_usb_audio.conf" +;; "options snd_usb_audio vid=")) + +(operating-system + (locale "en_GB.utf8") + (timezone "America/New_York") + (keyboard-layout (keyboard-layout "us")) + (host-name "lambda") + + (kernel rz/linux) + (kernel-loadable-modules rz/linux-kernel-modules) + (initrd microcode-initrd) + (firmware (list linux-firmware)) + + (groups (cons* (user-group (name "spice")) + (user-group (name "plugdev")) + %base-groups)) + ;; The list of user accounts ('root' is implicit). + (users (cons* (user-account + (name "robby") + (comment "Robby Zambito") + (group "users") + (home-directory "/home/robby") + (supplementary-groups '("wheel" "netdev" "audio" "video" "dialout" "libvirt" "kvm" "spice" "plugdev" "lp" "docker"))) + %base-user-accounts)) + (packages (append (specifications->packages (list "amdgpu-firmware" + "bluez" + "bluez-alsa" + "dbus" + "emacs" + "ffmpeg" + "gvfs" + "hplip" + "htop" + "libcamera" + "libinput" + "ncurses" + "ntfs-3g" + "pipewire" + ;; "purple-mattermost" + "ripgrep" +;; TODO fix + ;; "rocm-cmake" + ;; "rocm-opencl-runtime" + "steam-devices-udev-rules" + "sway" + "swaylock" + "udiskie" + "virt-manager" + "waypipe" + "wireplumber" + "xdg-desktop-portal" + "xdg-desktop-portal-wlr" + "xdg-user-dirs" + "xdg-utils")) + (list rz/linux-libre-headers + noisetorch) + %base-packages)) + (setuid-programs + (append + (list ;(setuid-program (program (file-append (specification->package "swaylock") "/bin/swaylock"))) + (setuid-program (program (file-append (specification->package "spice-gtk") "/libexec/spice-client-glib-usb-acl-helper"))) + (setuid-program (program (file-append noisetorch "/bin/NoiseTorch")))) + %setuid-programs)) + + ;; Below is the list of system services. To search for available + ;; services, run 'guix system search KEYWORD' in a terminal. + (services + (append (list + (service accountsservice-service-type) + (service alsa-service-type + (alsa-configuration (pulseaudio? #f))) + (service avahi-service-type) +; (service bitlbee-service-type +; (bitlbee-configuration +; (bitlbee bitlbee-purple) +; (plugins (list bitlbee-discord +; purple-mattermost)))) + (service bluetooth-service-type + (bluetooth-configuration + (auto-enable? #t))) + (service colord-service-type) + (service cups-pk-helper-service-type) + (service cups-service-type + (cups-configuration + (web-interface? #t))) + (service dbus-root-service-type) + (service containerd-service-type) + (service docker-service-type) + (service elogind-service-type) + (service geoclue-service-type) + (simple-service 'add-extra-hosts + hosts-service-type + (list (host "10.69.0.1" "stream.robbyzambito.me") + ;; (host "10.42.0.1" "robbyzambito.me") + (host "10.69.0.1" "git.robbyzambito.me") + (host "192.168.98.25" "file.pinfosec.dev") + (host "144.202.13.55" "mattermost.pinfosec.dev"))) + (service libvirt-service-type + (libvirt-configuration + (unix-sock-group "libvirt"))) + (service network-manager-service-type) + (service ntp-service-type) + ;; (service oci-container-service-type + ;; (list + ;; (oci-container-configuration + ;; (provision "nats-server") + ;; (image "nats") + ;; (network "host") + ;; (ports '("4222:4222")) + ;; (command '("-js" "-sd" "/var/js" "-c" "/etc/nats.conf")) + ;; (volumes (list "nats-jetstream:/var/js" + ;; (cons (string-append ;"accounts: { SYS: { } }\n" + ;; ;"system_account: SYS\n" + ;; ) + ;; "/etc/nats.conf")))))) + (service hostapd-service-type + (hostapd-configuration + (interface "wlp4s0") + (ssid "lambda"))) + ;; To configure OpenSSH, pass an 'openssh-configuration' + ;; record as a second argument to 'service' below. + (service openssh-service-type) + (service polkit-service-type + ;; (polkit-configuration + ;; (actions (list (plain-file "org.spice-space.lowlevelusbaccess.policy" (string-append "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<!DOCTYPE policyconfig PUBLIC\n" " \"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN\"\n" " \"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd\">\n" "<policyconfig>\n" "\n" " <vendor>The Spice Project</vendor>\n" " <vendor_url>http://spice-space.org/</vendor_url>\n" " <icon_name>spice</icon_name>\n" "\n" " <action id=\"org.spice-space.lowlevelusbaccess\">\n" " <description>Low level USB device access</description>\n" " <message>Privileges are required for low level USB device access (for usb device pass through).</message>\n" " <defaults>\n" " <allow_any>yes</allow_any>\n" " <allow_inactive>no</allow_inactive>\n" " <allow_active>yes</allow_active>\n" " </defaults>\n" " </action>\n" "\n" "</policyconfig>\n"))))) + ) + polkit-wheel-service + (simple-service 'ratbagd dbus-root-service-type (list libratbag)) + (service screen-locker-service-type + (screen-locker-configuration + (name "swaylock") + (program (file-append (specification->package "swaylock") "/bin/swaylock")) + (using-pam? #t) + (using-setuid? #f))) + (service tor-service-type) + (service udisks-service-type) + (udev-rules-service 'steam-devices steam-devices-udev-rules) + (udev-rules-service 'spice (udev-rule "50-spice.rules" + (string-append + "SUBSYSTEM==\"usb\", GROUP=\"spice\", MODE=\"0660\"\n" + "SUBSYSTEM==\"usb_device\", GROUP=\"spice\", MODE=\"0660\"\n"))) + (udev-rules-service 'zsa (udev-rule "50-zsa.rules" + (string-append + "# Rules for Oryx web flashing and live training\n" + "KERNEL==\"hidraw*\", ATTRS{idVendor}==\"16c0\", MODE=\"0664\", GROUP=\"plugdev\"\n" + "KERNEL==\"hidraw*\", ATTRS{idVendor}==\"3297\", MODE=\"0664\", GROUP=\"plugdev\"\n" + "# Wally Flashing rules for the Moonlander and Planck EZ\n" + "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"0483\", ATTRS{idProduct}==\"df11\", MODE:=\"0666\", SYMLINK+=\"stm32_dfu\"\n"))) + ;; TODO FIX + (service kernel-module-loader-service-type '("v4l2loopback")) + ;; (simple-service 'v4l2loopback-config etc-service-type + ;; (list `("modprobe.d/dslr-webcam.conf" + ;; ,dslr-webcam-config))) + (service wpa-supplicant-service-type)) + ;; This is the default list of services we + ;; are appending to. + %base-services)) + (bootloader (bootloader-configuration + (bootloader grub-efi-bootloader) + (targets (list "/boot/efi")) + (keyboard-layout keyboard-layout))) + (swap-devices (list (swap-space + (target (uuid + "7d57b644-4038-4966-8047-fb358ef79d5c"))))) + + ;; The list of file systems that get "mounted". The unique + ;; file system identifiers there ("UUIDs") can be obtained + ;; by running 'blkid' in a terminal. + (file-systems (cons* (file-system + (mount-point "/") + (device (uuid + "e4742181-2a6c-487f-b4dd-cc26930dbc7b" + 'ext4)) + (type "ext4")) + (file-system + (mount-point "/boot/efi") + (device (uuid "B1D3-6C95" + 'fat32)) + (type "vfat")) + (file-system + (mount-point "/home") + (device (uuid "c79fa858-ca01-46f8-b400-c4ab0e218986" + 'ext4)) + (type "ext4")) + %base-file-systems))) diff --git a/wofi/config b/wofi/config new file mode 100644 index 0000000..dadc360 --- /dev/null +++ b/wofi/config @@ -0,0 +1,23 @@ +stylesheet=/home/robby/.config/wofi/style.css +# xoffset=50% +xoffset=0 +# yoffset=50% +yoffset=0 +hide_scroll=true +show=drun +# width=15% +width=600px +lines=10 +line_wrap=word +term=alacritty +allow_markup=true +always_parse_args=true +show_all=true +print_command=true +layer=overlay +allow-images=true +insensitive=true +prompt=Hey, you should type something! +image_size=25 +display_generic=true +key_expand=Tab diff --git a/wofi/style.css b/wofi/style.css new file mode 100644 index 0000000..8f79768 --- /dev/null +++ b/wofi/style.css @@ -0,0 +1,72 @@ +#entry { +border-radius: 5px; +padding: 7px; +margin: 0px 5px 0px 5px; +} + +@keyframes fadeIn { + from {opacity: 0;} + to {opacity: 1;} +} + +#entry:selected { +background-color: #5e81ac; +} + +#text:selected { +color: #d8dee9; +} + +#window { +/*background-color: #3b4252;*/ +background-color: #FF4252; +background-color: transparent; +/*border-radius: 15px;*/ +font-family: Product Sans; +animation: fadeIn; +animation-duration: 0.5s; +} + +#input { +border: 2px solid #5e81ac; +background-color: #4c566a; +padding: 6px; +margin: 15px; +margin-bottom: 0px; +font-size: 16px; +border-radius: 5px; +} + +#inner-box { +color: #d8dee9; +padding: 10px; +padding-top: 5px; +} + +#outer-box { +margin: 15px; +/*margin: 150px 3700px;*/ +padding: 25px; +/*border-radius: 15px;*/ +/*background-color: rgba(53,59,73,1.0);*/ +border: 2px solid #bf616a; +background-color: #3b4252; +/*box-shadow: 0px 0px 5px 0 #0F0F0F;*/ +} + +#scroll { +margin-top: 10px; +margin-bottom: 10px; +} + +#text { +font-size: 16px; +padding: 7px; +color: #d8dee9; +background-color: transparent; +} + +#img { + background-color: transparent; + padding: 5px; +} |