From 9c8e94145fcfbe685bdb02f938aee341e5a9c006 Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Wed, 13 Dec 2023 03:02:44 +0100 Subject: [PATCH] . --- Makefile | 12 +- config.org | 22 +++- home/emacs/init.el | 144 ++++++++++++++------- home/emacs/templates | 28 ++++ home/home-configuration.scm | 249 ++++++++++++++++++------------------ library.org | 15 +-- 6 files changed, 277 insertions(+), 193 deletions(-) diff --git a/Makefile b/Makefile index 7021395..da5b226 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ ~/.config/guix/channels.scm: - mkdir -p ~/.config/guix - cp channels.scm ~/.config/guix/channels.scm + mkdir -p ~/.config/guix + cp channels.scm ~/.config/guix/channels.scm -install: - guix archive --authorize < signing-key.pub - guix system reconfigure ./config.scm --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org https://substitutes.nonguix.org' +reconfigure: + guix archive --authorize < signing-key.pub + guix system reconfigure ./config.scm --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org https://substitutes.nonguix.org' + make -C /home/zilti/.guix-home/profile/lib/browserpass make hosts-firefox-user + flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo diff --git a/config.org b/config.org index 1591434..e55ab60 100644 --- a/config.org +++ b/config.org @@ -10,13 +10,13 @@ * Makefile #+begin_src makefile :tangle Makefile - ~/.config/guix/channels.scm: - mkdir -p ~/.config/guix - cp channels.scm ~/.config/guix/channels.scm - - install: - guix archive --authorize < signing-key.pub - guix system reconfigure ./config.scm --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org https://substitutes.nonguix.org' + reconfigure: + mkdir -p ~/.config/guix + cp channels.scm ~/.config/guix/channels.scm + guix archive --authorize < signing-key.pub + guix system reconfigure ./config.scm --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org https://substitutes.nonguix.org' + make -C /home/zilti/.guix-home/profile/lib/browserpass make hosts-firefox-user + flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo #+end_src * System Installation Script @@ -57,6 +57,14 @@ This is to be run after setting up the partitions. <> #+end_src +#+RESULTS: +: ice-9/boot-9.scm:1685:16: In procedure raise-exception: +: Syntax error: +: unknown file:13:51: source expression failed to match any pattern in form or +: +: Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. +: scheme@(guile-user) [1]> + ** Service Modules #+NAME: service-module-list diff --git a/home/emacs/init.el b/home/emacs/init.el index df35ffa..92370f2 100644 --- a/home/emacs/init.el +++ b/home/emacs/init.el @@ -95,12 +95,14 @@ (tab-always-indent 'complete) (tool-bar-mode nil) :custom-face - (default ((t (:weight bold :height 113 :width normal :family "VictorMono Nerd Font")))) + ;;(default ((t (:weight bold :height 113 :width normal :family "VictorMono Nerd Font")))) + (default ((t (:weight regular :height 105 :width normal :family "MonaspiceXe Nerd Font Mono")))) :hook (minibuffer-setup . cursor-intangible-mode) :config (advice-add 'risky-local-variable-p :override #'ignore) - (global-display-fill-column-indicator-mode t)) + (global-display-fill-column-indicator-mode t) + (pixel-scroll-precision-mode 1)) ;;;; Org Mode (use-package org @@ -165,21 +167,40 @@ ;;(load-theme 'catppuccin) ) +(use-package unicode-fonts + :ensure t + :config + (unicode-fonts-setup)) + +(use-package ligature + :config + (ligature-set-ligatures + 't + '( ;; SS01 + "==" "===" "=/=" "!=" "!==" "/=" "/==" "~~" "=~" "!~" + ;; SS02 + ">=" "<=" + ;; SS03 + "->" "<-" "=>" "" "<~" "<~~" "~>" "~~>" "<~>" + ;; SS04 + "" "" "/\\" "\\/" + ;; SS05 + "|>" "<|" + ;; SS06 + "##" "###" + ;; SS07 + "***" "/*" "*/" "/*/" "(*" "*)" "(*)" + ;; SS08 + ".=" ".-" "..<" + ;; CALT + "//" "///" "&&" "!!" "??" "?." "?:" "||" "::" ":::" ";;" ".." "..." "=!=" "#=" ":=" "=:" "=:=" + ":>" ">:" "<:" ":<" "..=" "..-" + )) + (global-ligature-mode t)) + (set-frame-parameter nil 'alpha-background 80) (add-to-list 'default-frame-alist '(alpha-background . 80)) -;; (use-package powerline -;; :init -;; (require 'powerline) -;; :config -;; (powerline-default-theme)) - -;; (use-package airline-themes -;; :after powerline -;; :init (require 'airline-themes) -;; :config -;; (load-theme 'airline-badwolf t)) - (use-package lambda-line :straight (:type git :host github :repo "lambda-emacs/lambda-line") :custom @@ -290,6 +311,11 @@ completion-category-defaults nil completion-category-overrides '((file (styles basic partial-completion))))) +(use-package embark-consult + :after (embark consult) + :hook + (embark-collect-mode . consult-preview-at-point-mode)) + (use-package consult :config (require 'consult-flymake) @@ -309,11 +335,6 @@ ("C-" . 'embark-act) ("C-M-" . 'embark-bindings)) -(use-package embark-consult - :after (embark consult) - :hook - (embark-collect-mode . consult-preview-at-point-mode)) - (use-package wgrep :config (setq wgrep-auto-save-buffer t)) @@ -347,21 +368,22 @@ ;;;;; Code Completion (use-package cape - :init + :preface (defun my/capf () - (interactive) - (setq-local completion-at-point-functions - (list (cape-capf-super - #'tempel-complete - #'cape-dabbrev - #'cape-file - #'cape-dict - #'cape-line - #'cape-emoji - #'cape-keyword)))) + (setq completion-at-point-functions + (list (cape-capf-super + #'tempel-complete + #'cape-dabbrev + #'cape-file + #'cape-dict + #'cape-line + #'cape-emoji + #'cape-keyword)))) + :config (advice-add 'eglot-completion-at-point :around #'cape-wrap-buster) - (add-hook 'org-mode-hook #'my/capf) - (add-hook 'prog-mode-hook #'my/capf)) + :hook + (org-mode . my/capf) + (prog-mode . my/capf)) (defun my/corfu-combined-sort (candidates) "Sort CANDIDATES using both display-sort-function and corfu-sort-function." @@ -472,6 +494,8 @@ Point must be at the beginning of balanced expression (sexp)." clojure-ts-mode emacs-lisp-mode scheme-mode + :custom + (sp-undo-pairs-separately t) :config (add-to-list 'sp-clojure-modes 'clojure-ts-mode) (add-to-list 'sp-clojure-modes 'clojurec-ts-mode) @@ -479,6 +503,10 @@ Point must be at the beginning of balanced expression (sexp)." (add-to-list 'sp-lisp-modes 'clojure-ts-mode) (add-to-list 'sp-lisp-modes 'clojurec-ts-mode) (add-to-list 'sp-lisp-modes 'clojurescript-ts-mode) + (sp-local-pair '(emacs-lisp-mode scheme-mode clojure-ts-mode) + "'" nil) + (sp-local-pair '(emacs-lisp-mode scheme-mode clojure-ts-mode) + "`" nil) (evil-define-key 'insert smartparens-mode-map (kbd "r") (conditional-keybind #'looking-at-opening-paren #'sp-raise-sexp) @@ -488,6 +516,8 @@ Point must be at the beginning of balanced expression (sexp)." #'cc/move-sexp-forward) (kbd "c") (conditional-keybind #'looking-at-opening-paren #'sp-clone-sexp) + (kbd "m") (conditional-keybind #'looking-at-opening-paren + #'sp-mark-sexp) (kbd "DEL") (conditional-keybind #'being-past-closing-paren #'sp-backward-delete-sexp #'evil-delete-backward-char-and-join) @@ -529,17 +559,16 @@ Point must be at the beginning of balanced expression (sexp)." (use-package eglot :preface (defun my/eglot-capf () - (interactive) - (setq-local completion-at-point-functions - (list (cape-capf-super - #'eglot-completion-at-point - #'tempel-complete - #'cape-dabbrev - #'cape-file - #'cape-dict - #'cape-line - #'cape-emoji - #'cape-keyword)))) + (setq completion-at-point-functions + (list (cape-capf-super + #'eglot-completion-at-point + #'tempel-complete + #'cape-dabbrev + #'cape-file + #'cape-dict + #'cape-line + #'cape-emoji + #'cape-keyword)))) :custom (eglot-connect-timeout 90) (eglot-autoshutdown t) @@ -578,7 +607,7 @@ Point must be at the beginning of balanced expression (sexp)." (call-interactively #'eglot-format-buffer)) nil 'local))) (eglot-managed-mode . eglot-inlay-hints-mode) - (eglot-managed-mode . #'my/eglot-capf)) + (eglot-managed-mode . my/eglot-capf)) (use-package consult-eglot :after (consult eglot)) @@ -628,10 +657,24 @@ Point must be at the beginning of balanced expression (sexp)." ;;;;; Scheme (use-package geiser + :preface + (defun my/geiser-capf () + (setq completion-at-point-functions + (append geiser-capf--capfs + (list (cape-capf-super + #'tempel-complete + #'cape-dabbrev + #'cape-file + #'cape-dict + #'cape-line + #'cape-emoji + #'cape-keyword))))) :custom (geiser-chicken-match-limit 200) :config - (defalias 'run-geiser 'geiser)) + (defalias 'run-geiser 'geiser) + :hook + (geiser-mode . my/geiser-capf)) (use-package paren-face :hook @@ -644,10 +687,8 @@ Point must be at the beginning of balanced expression (sexp)." ;;;;;; Chicken Scheme (use-package scheme :config - (eval-after-load 'eglot - '(add-to-list 'eglot-server-programs - '(scheme-mode - . ("chicken-lsp-server")))) + (setq prettify-symbols-alist + '(("lambda" . "λ"))) :hook (scheme-mode . eglot-ensure)) @@ -752,5 +793,10 @@ Point must be at the beginning of balanced expression (sexp)." :encryption tls :channels ())))) +;;;; Wrapping Up +(use-package envrc + :config + (envrc-global-mode)) + (provide 'init) ;;; init.el ends here diff --git a/home/emacs/templates b/home/emacs/templates index 1760bed..74e8893 100644 --- a/home/emacs/templates +++ b/home/emacs/templates @@ -15,6 +15,34 @@ prog-mode scheme-mode +(crate-dependency + "(\"rust-" crate-name "\" ,rust-" (s crate-name) "-" p ")") + +(define-guix-crate + "(define-public rust-" (s egg-name) "-" (s maj-version) + n> "(package" + n> "(name \"rust-" egg-name "\")" + n> "(version \"" maj-version "." (s egg-version) "\")" + n> "(source" + n> "(origin" + n> "(method url-fetch)" + n> "(uri (crate-uri \"" egg-name "\" version))" + n> "(sha256" + n> "(base32" + n> "\"0z05x7f154n9bgmainrsmncf5i6dil43r9ymr3rdgwbg4wnxmz4s\"))))" + n> "(build-system cargo-build-system)" + n> "(arguments" + n> "`(#:cargo-inputs" + n> "(" p ")" + n> "#:cargo-development-inputs" + n> "(" p ")" + n> "#:cargo-build-inputs" + n> "(" p ")))" + n> "(synopsis \"" (s synopsis) "\")" + n> "(home-page \"https://crates.io/crates/" egg-name "\")" + n> "(description \"" synopsis ".\")" + n> "(license license:" (s license) ")))") + (define-guix-egg "(define-public chicken-" (s egg-name) n> "(package" diff --git a/home/home-configuration.scm b/home/home-configuration.scm index cb555d6..d86540d 100644 --- a/home/home-configuration.scm +++ b/home/home-configuration.scm @@ -30,6 +30,7 @@ (specifications->packages (list "bsd-games" "bolt" + "browserpass-native" "chicken" "chicken-apropos" "chicken-chicken-doc" @@ -37,10 +38,11 @@ "curl" "direnv" "emacs" - "emacs-direnv" + "eternalterminal" "diff-so-fancy" "firefox" "flatpak" + "font-nerdfont-monaspice" "fuzzel" "gammastep" "grim" @@ -49,6 +51,9 @@ "icecat" "icedove-wayland" "kitty" + "ksshaskpass" + "make" + "nm-tray" #;"nss-certs" ; This package is broken "password-store" "pass-otp" @@ -65,129 +70,131 @@ "swayfx" "swayidle" "swaylock-effects" + "unzip" "waybar" "wlogout" "xdg-desktop-portal"))) ;; Below is the list of Home services. To search for available ;; services, run 'guix home search KEYWORD' in a terminal. (services -(list - (service home-shepherd-service-type) - (service home-msmtp-service-type - (home-msmtp-configuration - (default-account "LMail") - (accounts - (list - (msmtp-account - (name "LMail") - (configuration - (msmtp-configuration - (host "lyrion.ch") - (port 465) - (auth? #t) - (tls? #t) - (tls-starttls? #f) - (user "dziltener") - (from "dziltener@lyrion.ch") - (password-eval "pass Privat/Mailaccount | head -n 1")))) - (msmtp-account - (name "Red Sky") - (configuration - (msmtp-configuration - (host "gmail.com") - (port 587) - (auth? #t) - (tls? #t) - (tls-starttls? #f) - (user "dz@redsky.io") - (from "dziltener@lyrion.ch") - (password-eval "pass Privat/RedSkyGMail")))))))) - (simple-service 'ziltis-environment-variable-service - home-environment-variables-service-type - `(("PATH" . "$PATH:~/.local/bin") - ("PASSWORD_STORE_DIR" . "$XDG_DATA_HOME/password-store") - ("SSH_ASKPASS" . "ksshaskpass") - ("ELM_DISPLAY" . "wl") - ("SDL_VIDEODRIVER" . "wayland") - ("MOZ_ENABLE_WAYLAND" . "1") - ("SSL_CERT_FILE" . "$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt") - ("CHICKEN_DOC_REPOSITORY" . "$XDG_DATA_HOME/chicken/doc") - ;; ("CHICKEN_INSTALL_REPOSITORY" . "$XDG_DATA_HOME/chicken/eggs") - ;; ("CHICKEN_REPOSITORY_PATH" . "$HOME/.guix-home/profile/var/lib/chicken/11/:$XDG_DATA_HOME/chicken/eggs") - ;; ("CHICKEN_INSTALL_PREFIX" . "$HOME/.local") - )) - (simple-service 'ziltis-home-files-service - home-files-service-type - `(#;(".gnupg/gpg-agent.conf" ,(local-file "gnupg/gpg-agent.conf")))) - (simple-service 'ziltis-xdg-configuration-files-service - home-xdg-configuration-files-service-type - `(("sway/config" ,(local-file "./sway/sway")) - ("waybar/config" ,(local-file "./waybar/config")) - ("waybar/style.css" ,(local-file "./waybar/style.css")) - ("fuzzel/fuzzel.ini" ,(local-file "./fuzzel/fuzzel.ini")) - ("git/config" ,(local-file "./git/config")) - ("emacs/init.el" ,(local-file "./emacs/init.el")) - ("emacs/init.org" ,(local-file "./emacs/init.org")) - ("emacs/templates" ,(local-file "./emacs/templates")) - ("kitty/kitty.conf" ,(local-file "./kitty/kitty.conf")) - ("senpai/senpai.scfg" ,(local-file "./senpai/senpai.scfg")))) - (service home-bash-service-type - (home-bash-configuration - (aliases - '(("hh" . "hstr") - ("l" . "ls -alh") - ("ll" . "ls -l") - ("ls" . "ls --color=tty") - ("create-guix-patch" . "git format-patch --minimal --to guix-patches@gnu.org --cc dziltener@lyrion.ch --inline --no-attach master; ls *.patch | xargs sed -i '1d'") - ("send-guix-patch-series" . "for FILE in $(ls *.patch); do cat $FILE | msmtp -t; done"))) - (bashrc - (list - (local-file - "./.bashrc" - "bashrc"))) - (bash-profile - (list - (local-file - "./.bash_profile" - "bash_profile"))))) - (service home-batsignal-service-type - (home-batsignal-configuration - (ignore-missing? #t))) - (service home-mcron-service-type - (home-mcron-configuration - (jobs - '()))) - (simple-service 'ziltis-channels - home-channels-service-type - (list - (channel - (name 'ziltis-channel) - (url "https://gitea.lyrion.ch/zilti/guixchannel")) - (channel - (name 'nongnu-guix) - (url "https://gitlab.com/nonguix/nonguix")))) - (service home-openssh-service-type - (home-openssh-configuration - (hosts - (list - (openssh-host - (name "www.opencode.net") - (host-name "www.opencode.net") - (user "git") - (identity-file "~/.ssh/personal_ed")) - (openssh-host - (name "gitea.lyrion.ch") - (host-name "gitea.lyrion.ch") - (user "git") - (port 7920) - (identity-file "~/.ssh/personal_ed")))))) - (service home-gpg-agent-service-type - (home-gpg-agent-configuration - (pinentry-program - (file-append pinentry-qt "/bin/pinentry-qt")) - (ssh-support? #t) - (default-cache-ttl 7200) - (default-cache-ttl-ssh 7200) - (extra-content "grab\nallow-emacs-pinentry\nallow-loopback-pinentry"))) - (service home-dbus-service-type) - ))) + (list + (service home-shepherd-service-type) + (service home-msmtp-service-type + (home-msmtp-configuration + (default-account "LMail") + (accounts + (list + (msmtp-account + (name "LMail") + (configuration + (msmtp-configuration + (host "lyrion.ch") + (port 465) + (auth? #t) + (tls? #t) + (tls-starttls? #f) + (user "dziltener") + (from "dziltener@lyrion.ch") + (password-eval "pass Privat/Mailaccount | head -n 1")))) + (msmtp-account + (name "Red Sky") + (configuration + (msmtp-configuration + (host "gmail.com") + (port 587) + (auth? #t) + (tls? #t) + (tls-starttls? #f) + (user "dz@redsky.io") + (from "dziltener@lyrion.ch") + (password-eval "pass Privat/RedSkyGMail")))))))) + (simple-service 'ziltis-environment-variable-service + home-environment-variables-service-type + `(("PATH" . "$PATH:~/.local/bin") + ("PASSWORD_STORE_DIR" . "$XDG_DATA_HOME/password-store") + ("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$XDG_DATA_HOME/flatpak/exports/share") + ("SSH_ASKPASS" . "ksshaskpass") + ("ELM_DISPLAY" . "wl") + ("SDL_VIDEODRIVER" . "wayland") + ("MOZ_ENABLE_WAYLAND" . "1") + ("SSL_CERT_FILE" . "$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt") + ("CHICKEN_DOC_REPOSITORY" . "$XDG_DATA_HOME/chicken/doc") + ;; ("CHICKEN_INSTALL_REPOSITORY" . "$XDG_DATA_HOME/chicken/eggs") + ;; ("CHICKEN_REPOSITORY_PATH" . "$HOME/.guix-home/profile/var/lib/chicken/11/:$XDG_DATA_HOME/chicken/eggs") + ;; ("CHICKEN_INSTALL_PREFIX" . "$HOME/.local") + )) + (simple-service 'ziltis-home-files-service + home-files-service-type + `(#;(".gnupg/gpg-agent.conf" ,(local-file "gnupg/gpg-agent.conf")))) + (simple-service 'ziltis-xdg-configuration-files-service + home-xdg-configuration-files-service-type + `(("sway/config" ,(local-file "./sway/sway")) + ("waybar/config" ,(local-file "./waybar/config")) + ("waybar/style.css" ,(local-file "./waybar/style.css")) + ("fuzzel/fuzzel.ini" ,(local-file "./fuzzel/fuzzel.ini")) + ("git/config" ,(local-file "./git/config")) + ("emacs/init.el" ,(local-file "./emacs/init.el")) + ("emacs/init.org" ,(local-file "./emacs/init.org")) + ("emacs/templates" ,(local-file "./emacs/templates")) + ("kitty/kitty.conf" ,(local-file "./kitty/kitty.conf")) + ("senpai/senpai.scfg" ,(local-file "./senpai/senpai.scfg")))) + (service home-bash-service-type + (home-bash-configuration + (aliases + '(("hh" . "hstr") + ("l" . "ls -alh") + ("ll" . "ls -l") + ("ls" . "ls --color=tty") + ("create-guix-patch" . "git format-patch --minimal --to guix-patches@gnu.org --cc dziltener@lyrion.ch --inline --no-attach master; ls *.patch | xargs sed -i '1d'") + ("send-guix-patch-series" . "for FILE in $(ls *.patch); do cat $FILE | msmtp -t; done"))) + (bashrc + (list + (local-file + "./.bashrc" + "bashrc"))) + (bash-profile + (list + (local-file + "./.bash_profile" + "bash_profile"))))) + (service home-batsignal-service-type + (home-batsignal-configuration + (ignore-missing? #t))) + (service home-mcron-service-type + (home-mcron-configuration + (jobs + '()))) + (simple-service 'ziltis-channels + home-channels-service-type + (list + (channel + (name 'ziltis-channel) + (url "https://gitea.lyrion.ch/zilti/guixchannel")) + (channel + (name 'nongnu-guix) + (url "https://gitlab.com/nonguix/nonguix")))) + (service home-openssh-service-type + (home-openssh-configuration + (hosts + (list + (openssh-host + (name "www.opencode.net") + (host-name "www.opencode.net") + (user "git") + (identity-file "~/.ssh/personal_ed")) + (openssh-host + (name "gitea.lyrion.ch") + (host-name "gitea.lyrion.ch") + (user "git") + (port 7920) + (identity-file "~/.ssh/personal_ed")))))) + (service home-gpg-agent-service-type + (home-gpg-agent-configuration + (pinentry-program + (file-append pinentry-qt "/bin/pinentry-qt")) + (ssh-support? #t) + (default-cache-ttl 7200) + (default-cache-ttl-ssh 7200) + (extra-content "grab\nallow-emacs-pinentry\nallow-loopback-pinentry"))) + (service home-dbus-service-type) + ))) diff --git a/library.org b/library.org index bcb197f..4d038c8 100644 --- a/library.org +++ b/library.org @@ -23,24 +23,17 @@ Converting org lists into guix ~use-~ calls. Converting Org lists into Scheme symbol lists. -#+NAME: sym-list-sample +#+NAME: list-sample - Entry 1 - Entry 2 #+NAME: org-to-scheme-sym-list -#+begin_src scheme :var input=sym-list-sample :results output +#+begin_src scheme :var data=list-sample (pretty-print - `(list - ,@(map (lambda (x) (string->symbol x)) input))) + (cons 'list + (map string->symbol input))) #+end_src -#+RESULTS: org-to-scheme-sym-list -: ice-9/boot-9.scm:1685:16: In procedure raise-exception: -: Wrong type to apply: "Entry 1" -: -: Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. -: scheme@(guile-user) [1]> - * Converting Tables #+NAME: service-converter