From 9eefbce8cfb222b56ea25c8c72f70147162d832f Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Thu, 16 Nov 2023 11:30:36 +0100 Subject: [PATCH] It's Chicken Time --- Makefile | 3 ++ chicken/chicken.nix | 14 ++++++ emacs/emacs.nix | 1 + emacs/init.el | 82 +++++++++++++++++++++------------ home.nix | 107 +++++++++++++++++++++----------------------- 5 files changed, 123 insertions(+), 84 deletions(-) create mode 100644 chicken/chicken.nix diff --git a/Makefile b/Makefile index 3aaf286..c1a439e 100644 --- a/Makefile +++ b/Makefile @@ -26,4 +26,7 @@ install-system: configuration.nix cp disko-config.nix /mnt/etc/nixos nixos-install +install: + env NIXPKGS_ALLOW_BROKEN=1 nixos-rebuild switch --flake . --impure + # end diff --git a/chicken/chicken.nix b/chicken/chicken.nix new file mode 100644 index 0000000..ed13837 --- /dev/null +++ b/chicken/chicken.nix @@ -0,0 +1,14 @@ +{ config, libs, pkgs, ... }: + +{ + config.home.packages = with pkgs.chickenPackages_5.chickenEggs; [ + chicken-update + csm + edn + lsp-server + mistie + nanomsg + r7rs + srfi-197 + ] ++ [ pkgs.chicken ]; +} diff --git a/emacs/emacs.nix b/emacs/emacs.nix index e13e639..bc7a9a4 100644 --- a/emacs/emacs.nix +++ b/emacs/emacs.nix @@ -51,6 +51,7 @@ moe-theme nerd-icons-completion nerd-icons-corfu + nix-mode nix-ts-mode orderless org diff --git a/emacs/init.el b/emacs/init.el index 7dccebd..89e5508 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -7,7 +7,11 @@ ;; Created: November 13, 2023 ;; Modified: November 13, 2023 ;; Version: 0.0.1 -;; Keywords: abbrev bib c calendar comm convenience data docs emulations extensions faces files frames games hardware help hypermedia i18n internal languages lisp local maint mail matching mouse multimedia news outlines processes terminals tex tools unix vc wp +;; Keywords: abbrev bib c calendar comm convenience data docs +;; emulations extensions faces files frames games hardware help +;; hypermedia i18n internal languages lisp local maint mail matching +;; mouse multimedia news outlines processes terminals tex tools unix +;; vc wp ;; Homepage: https://github.com/dziltener@lyrion.ch/init ;; Package-Requires: ((emacs "24.3")) ;; @@ -53,12 +57,19 @@ (use-package emacs :custom (completion-cycle-threshold 10) - (read-extended-command-predicate #'command-completion-default-include-p) + (read-extended-command-predicate + #'command-completion-default-include-p) + (minibuffer-prompt-properties + (read-only t cursor-intangible t face minibuffer-prompt)) (tab-always-indent 'complete) + (enable-recursive-minibuffers t) (global-hl-line-mode t) (menu-bar-mode nil) (scroll-bar-mode nil) - (tool-bar-mode nil)) + (tool-bar-mode nil) + (recentf-mode t) + :hook + (minibuffer-setup . cursor-intangible-mode)) ;;;; Org Mode (use-package org @@ -157,8 +168,10 @@ (savehist-mode)) (use-package orderless - :after eglot + :after consult :config + (eval-after-load 'eglot + (lambda () (setq completion-category-defaults nil))) (setq completion-styles '(orderless basic) completion-category-defaults nil completion-category-overrides '((file (styles partial-completion))))) @@ -167,8 +180,9 @@ :bind (:map evil-normal-state-map ("" . 'consult-find) - ("es" . 'consult-eglot-symbols) + ("gs" . 'consult-eglot-symbols) ("b" . 'consult-buffer) + ("gb" . 'consult-project-buffer) ("g/" . 'consult-git-grep) ("/" . 'consult-grep) ("/" . 'consult-line))) @@ -239,14 +253,7 @@ :commands global-corfu-mode :init - (global-corfu-mode) - ;:bind - ;; (:map corfu-map - ;; ("TAB" . corfu-next) - ;; ([tab] . corfu-next) - ;; ("S-TAB" . corfu-previous) - ;; ([backtab] . corfu-previous)) - ) + (global-corfu-mode)) (use-package corfu-history :config @@ -269,13 +276,12 @@ (add-to-list 'corfu-margin-formatters 'nerd-icons-corfu-formatter)) (use-package corfu-terminal - :if (display-graphic-p) + :if (not (display-graphic-p)) :after corfu :commands corfu-terminal-mode :init (corfu-terminal-mode +1)) - (use-package tempel) ;;;; Basic Navigation @@ -327,11 +333,17 @@ :init (editorconfig-mode 1)) +(use-package flymake) + +(use-package consult-flymake + :after (consult flymake)) + (defun my/eglot-capf () (setq-local completion-at-point-functions (list (cape-super-capf #'eglot-completion-at-point #'tempel-complete + #'cape-dabbrev #'cape-file #'cape-dict)))) @@ -391,10 +403,14 @@ :hook ((clojure-ts-mode . eglot-ensure) (clojure-ts-mode . rainbow-delimiters-mode) - (clojure-ts-mode . (lambda () (setq-local sesman-system 'CIDER))) - (clojure-ts-mode . (lambda () (sesman-install-menu clojure-mode-map))) - (clojurec-ts-mode . (lambda () (sesman-install-menu clojurec-mode-map))) - (clojurescript-ts-mode . (lambda () (sesman-install-menu clojurescript-mode-map)))) + (clojure-ts-mode . (lambda () + (setq-local sesman-system 'CIDER))) + (clojure-ts-mode . (lambda () + (sesman-install-menu clojure-mode-map))) + (clojurec-ts-mode . (lambda () + (sesman-install-menu clojurec-mode-map))) + (clojurescript-ts-mode . (lambda () + (sesman-install-menu clojurescript-mode-map)))) :mode ("\\.clj\\'" . #'clojure-ts-mode) ("\\.cljc\\'" . #'clojurec-ts-mode) @@ -403,9 +419,12 @@ (add-to-list 'lispy-clojure-modes 'clojure-ts-mode) (add-to-list 'lispy-clojure-modes 'clojurec-ts-mode) (add-to-list 'lispy-clojure-modes 'clojurescript-ts-mode) - (add-to-list 'tree-sitter-major-mode-language-alist '(clojure-ts-mode . clojure)) - (add-to-list 'tree-sitter-major-mode-language-alist '(clojurec-ts-mode . clojure)) - (add-to-list 'tree-sitter-major-mode-language-alist '(clojurescript-ts-mode . clojure))) + (add-to-list 'tree-sitter-major-mode-language-alist + '(clojure-ts-mode . clojure)) + (add-to-list 'tree-sitter-major-mode-language-alist + '(clojurec-ts-mode . clojure)) + (add-to-list 'tree-sitter-major-mode-language-alist + '(clojurescript-ts-mode . clojure))) (use-package cider :hook @@ -418,7 +437,8 @@ ;;;;; Chicken Scheme (defun flymake-chicken-init () - (add-hook 'flymake-diagnostic-functions #'flymake-chicken-backend nil t) + (add-hook 'flymake-diagnostic-functions + #'flymake-chicken-backend nil t) (flymake-mode)) (use-package geiser @@ -432,7 +452,8 @@ :custom (lsp-scheme-implementation "chicken") :config - (progn (add-to-list 'eglot-server-programs '(scheme-mode . ("chicken-lsp-server")))) + (progn (add-to-list 'eglot-server-programs + '(scheme-mode . ("chicken-lsp-server")))) (require 'lsp-scheme)) ;; (use-package flymake-chicken @@ -445,10 +466,10 @@ ;; (add-hook 'flymake-diagnostic-functions #'flymake-chicken-backend nil t)) ;;;; Other Languages -(use-package nix-ts-mode +(use-package nix-mode :hook eglot-ensure - :mode ("\\.nix\\'" . nix-ts-mode)) + :mode ("\\.nix\\'" . nix-mode)) ;; (use-package lsp-tailwindcss ;; :init @@ -478,7 +499,8 @@ (use-package forge :after magit :config - (advice-add 'magit :after (lambda (&rest _args) (call-interactively #'forge-pull)))) + (advice-add 'magit :after (lambda (&rest _args) + (call-interactively #'forge-pull)))) (use-package code-review :after forge @@ -490,7 +512,8 @@ ;;;; LaTeX ;; https://github.com/politza/pdf-tools/#known-problems -(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer) +(add-hook 'TeX-after-compilation-finished-functions + #'TeX-revert-document-buffer) ;;;; Communication ;;;;; IRC @@ -506,7 +529,8 @@ :tls t :nick "zilti" :sasl-username "zilti/irc.libera.chat" - :sasl-password (lambda (_) (password-store-get "Privat/Soju")))))) + :sasl-password (lambda (_) + (password-store-get "Privat/Soju")))))) (provide 'init) ;;; init.el ends here diff --git a/home.nix b/home.nix index f4e10c7..2be21c4 100644 --- a/home.nix +++ b/home.nix @@ -5,74 +5,71 @@ args@{ config, pkgs, hyprland, split-monitor-workspaces, flatpaks, ... }: home.homeDirectory = "/home/zilti"; home.packages = with pkgs; [ - pwvucontrol - sysstat - lm_sensors - pciutils - usbutils - coreutils-full - unzip - (nerdfonts.override { fonts = [ "VictorMono" "MPlus" ]; }) - lagrange - stow - nixfmt - pinentry-qt - libsForQt5.ksshaskpass - swappy - grim - slurp - hyprpaper - gamescope - git-cola - fossil - nil - gcc - libgccjit + SDL2 + babashka + bitwarden chicken + clj-kondo clojure clojure-lsp - clj-kondo - babashka - podman-compose - sqlite - nodejs_20 - sqlite - tofi - pinentry-qt - wlr-randr - nwg-displays - libsForQt5.okular - libsForQt5.dolphin - kteatime + coreutils-full discord - bitwarden + fossil freetube - space-cadet-pinball - qtpass - ungoogled-chromium - slack - signal-desktop - telegram-desktop - zoom-us - git-filter-repo - git-doc - # For pharo freetype - pixman - SDL2 + gamescope + gcc + git-cola + git-doc + git-filter-repo + grim + hyprpaper + iconv + kteatime + lagrange libffi - libuuid + libgccjit + libsForQt5.dolphin libsForQt5.ksshaskpass - perl538Packages.IOSocketSSL + libsForQt5.okular + libuuid + lm_sensors + (nerdfonts.override { fonts = [ "VictorMono" "MPlus" ]; }) + nil + nixfmt + nodejs_20 + nwg-displays + pciutils perl538Packages.DigestHMAC - perl538Packages.TermReadKey - perl538Packages.MIMELite perl538Packages.FileLibMagic perl538Packages.IOSocketINET6 - iconv + perl538Packages.IOSocketSSL + perl538Packages.MIMELite + perl538Packages.TermReadKey + pinentry-qt + pixman + podman-compose + pwvucontrol + qtpass + signal-desktop + slack + slurp + space-cadet-pinball + sqlite + stow + swappy + sysstat + telegram-desktop + tofi + ungoogled-chromium + unzip + usbutils + wlr-randr + zoom-us ]; - imports = [ ./hyprland/hyprland.nix ./waybar/settings.nix ./emacs/emacs.nix ]; + imports = [ ./hyprland/hyprland.nix ./waybar/settings.nix ./emacs/emacs.nix + ./chicken/chicken.nix ]; home.stateVersion = "23.11"; programs.home-manager.enable = true;