From 244edc5ca652c7381d7677c29de8e46e8225c15f Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Fri, 21 Nov 2025 23:57:30 +0100 Subject: [PATCH] Emacs tune, some updates, direnv --- files/.config/niri/config.kdl | 27 ++++++++-------- guix-config/channels-lock.scm | 2 +- guix-config/home/direnv.sh | 1 + guix-config/home/emacs/config.el | 29 +++++++++++++++++ guix-config/home/workstation.scm | 52 +++++++++++++++++------------- guix-config/packages/emacs.scm | 1 + guix-config/system/base-system.scm | 5 +-- 7 files changed, 77 insertions(+), 40 deletions(-) create mode 100644 guix-config/home/direnv.sh diff --git a/files/.config/niri/config.kdl b/files/.config/niri/config.kdl index dc987b2..8ea6d6f 100644 --- a/files/.config/niri/config.kdl +++ b/files/.config/niri/config.kdl @@ -272,9 +272,10 @@ layout { // See the binds section below for more spawn examples. spawn-sh-at-startup "emacs --daemon" +spawn-at-startup "secretsd" // To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup: -spawn-sh-at-startup "qs -c dms" +//spawn-sh-at-startup "qs -c dms" spawn-sh-at-startup "wl-paste --watch cliphist store &" spawn-sh-at-startup "nextcloud --background" @@ -382,42 +383,42 @@ binds { // Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc. Mod+Space hotkey-overlay-title="Application Launcher" { - spawn-sh "qs -c dms ipc call spotlight toggle"; + spawn-sh "dms ipc call spotlight toggle"; } Mod+V hotkey-overlay-title="Clipboard Manager" { - spawn-sh "qs -c dms ipc call clipboard toggle"; + spawn-sh "dms ipc call clipboard toggle"; } Mod+M hotkey-overlay-title="Task Manager" { - spawn-sh "qs -c dms ipc call processlist toggle"; + spawn-sh "dms ipc call processlist toggle"; } Super+L hotkey-overlay-title="Lock Screen" { - spawn-sh "qs -c dms ipc call lock lock"; + spawn-sh "dms ipc call lock lock"; } Mod+Y hotkey-overlay-title="Browse Wallpapers" { - spawn-sh "qs -c dms ipc call dankdash wallpaper"; + spawn-sh "dms ipc call dankdash wallpaper"; } XF86AudioRaiseVolume allow-when-locked=true { - spawn-sh "qs -c dms ipc call audio increment 3"; + spawn-sh "dms ipc call audio increment 3"; } XF86AudioLowerVolume allow-when-locked=true { - spawn-sh "qs -c dms ipc call audio decrement 3"; + spawn-sh "dms ipc call audio decrement 3"; } XF86AudioMute allow-when-locked=true { - spawn-sh "qs -c dms ipc call audio mute"; + spawn-sh "dms ipc call audio mute"; } XF86AudioMicMute allow-when-locked=true { - spawn-sh "qs -c dms ipc call audio micmute"; + spawn-sh "dms ipc call audio micmute"; } XF86MonBrightnessUp allow-when-locked=true { - spawn-sh "qs -c dms ipc call brightness increment 5 ''"; + spawn-sh "dms ipc call brightness increment 5 ''"; } // You can override the default device for e.g. keyboards by adding the device name to the last param XF86MonBrightnessDown allow-when-locked=true { - spawn-sh "qs -c dms ipc call brightness decrement 5 ''"; + spawn-sh "dms ipc call brightness decrement 5 ''"; } // Night mode toggle Mod+Shift+N allow-when-locked=true { - spawn "dms" "ipc" "call" "night" "toggle"; + spawn-sh "dms ipc call night toggle"; } // Open/close the Overview: a zoomed-out view of workspaces and windows. // You can also move the mouse into the top-left hot corner, diff --git a/guix-config/channels-lock.scm b/guix-config/channels-lock.scm index 6678c5c..a43c1f6 100644 --- a/guix-config/channels-lock.scm +++ b/guix-config/channels-lock.scm @@ -3,7 +3,7 @@ (url "https://git.guix.gnu.org/guix.git") (branch "master") (commit - "b1c1e42215190b67db55117509dc9ee4af434246") + "157f2e8732157ecb5d3084afbbb8fb2891cbf342") (introduction (make-channel-introduction "9edb3f66fd807b096b48283debdcddccfea34bad" diff --git a/guix-config/home/direnv.sh b/guix-config/home/direnv.sh new file mode 100644 index 0000000..885c279 --- /dev/null +++ b/guix-config/home/direnv.sh @@ -0,0 +1 @@ +eval "$(direnv hook bash)" diff --git a/guix-config/home/emacs/config.el b/guix-config/home/emacs/config.el index 4aa3508..b9ac080 100644 --- a/guix-config/home/emacs/config.el +++ b/guix-config/home/emacs/config.el @@ -547,6 +547,12 @@ DIR must include a .project file to be considered a project." (add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-ts-mode)) (add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-ts-mode)) +(use-package zig-mode + :ensure t) + +(autoload 'zig-mode "zig-mode" nil t) +(add-to-list 'auto-mode-alist '("\\.\\(zig\\|zon\\)\\'" . zig-mode)) + (use-package treesit-auto :ensure t :demand t @@ -592,6 +598,29 @@ DIR must include a .project file to be considered a project." (add-hook 'c-ts-mode-hook #'eglot-ensure) (add-hook 'c++-ts-mode-hook #'eglot-ensure)) +(with-eval-after-load 'eglot + (add-to-list 'eglot-server-programs + '(zig-mode . ( + ;; Use `zls` if it is in your PATH + "zls" + ;; There are two ways to set config options: + ;; - edit your `zls.json` that applies to any editor that uses ZLS + ;; - set in-editor config options with the `initializationOptions` field below. + ;; + ;; Further information on how to configure ZLS: + ;; https://zigtools.org/zls/configure/ + :initializationOptions + (;; Whether to enable build-on-save diagnostics + ;; + ;; Further information about build-on save: + ;; https://zigtools.org/zls/guides/build-on-save/ + ;;enable_build_on_save t + + ;; omit the following line if `zig` is in your PATH + ;:zig_exe_path "/path/to/zig_executable" + )))) + (add-hook 'zig-mode-hook #'eglot-ensure)) + (with-eval-after-load 'eglot (add-to-list 'eglot-server-programs '(csharp-ts-mode diff --git a/guix-config/home/workstation.scm b/guix-config/home/workstation.scm index 110667e..a4b4126 100644 --- a/guix-config/home/workstation.scm +++ b/guix-config/home/workstation.scm @@ -2,6 +2,7 @@ #:use-module (gnu home) #:use-module (gnu packages emacs) #:use-module (gnu packages glib) + #:use-module (gnu packages shellutils) #:use-module (gnu packages gnuzilla) #:use-module (gnu packages mail) #:use-module (gnu packages messaging) @@ -11,6 +12,7 @@ #:use-module (gnu packages wm) #:use-module (gnu packages terminals) #:use-module (gnu packages xorg) + #:use-module (gnu packages kde-internet) #:use-module (gnu packages linux) #:use-module (gnu packages freedesktop) #:use-module (gnu packages rust-apps) @@ -35,7 +37,14 @@ #:use-module (guix-config home services emacs) #:use-module (guix-config home services flatpak) #:use-module (guix-config home services secretsd) - #:use-module (gnu home services niri)) + #:use-module (gnu home services niri) + #:use-module (guix transformations) + #:use-module (guix packages) + #:use-module (gnu home services dankmaterialshell) +) + +(define tune + (options->transformation '((tune . "alderlake")))) (home-environment ;; Below is the list of packages that will show up in your @@ -49,29 +58,27 @@ vlc font-google-noto-emoji font-openmoji + direnv + (package + (inherit neochat) + (propagated-inputs (modify-inputs (package-propagated-inputs neochat) + (append qtpositioning)))) - ;birdtray + birdtray nextcloud-client + icedove nautilus - xournalpp - quickshell - cava - wl-clipboard - cliphist - brightnessctl - qtmultimedia - `(,glib "bin") - matugen - dgop - wayland - xwayland-satellite - qtwayland)) + xournalpp)) ;; Below is the list of Home services. To search for available ;; services, run 'guix home search KEYWORD' in a terminal. (services - (append (list (service home-niri-service-type) + (append (list (service home-dankmaterialshell-service-type + (home-dankmaterialshell-configuration + (launch-command (file-append niri "/bin/niri msg action spawn-sh --")))) + (service home-niri-service-type) (service home-pipewire-service-type) + (service home-wayland-service-type) (service home-dbus-service-type) (service home-bash-service-type (home-bash-configuration @@ -89,17 +96,18 @@ ("guix-full-upgrade" . "guix-pull && reconfigure"))) (bashrc - (list (local-file "prompt.sh"))))) + (list (local-file "prompt.sh") + (local-file "direnv.sh"))))) (service home-dotfiles-service-type (home-dotfiles-configuration (directories '("../../files")))) - (service home-secretsd-service-type) - (service home-flatpak-service-type - (home-flatpak-configuration - (apps '("in.cinny.Cinny")))) + ;(service home-secretsd-service-type) + ;(service home-flatpak-service-type + ; (home-flatpak-configuration + ; (apps '("in.cinny.Cinny")))) (service home-emacs-service-type (home-emacs-configuration - (emacs guixmacs) + (emacs (tune guixmacs)) (config-file (local-file "./emacs/config.el")) (early-config-file diff --git a/guix-config/packages/emacs.scm b/guix-config/packages/emacs.scm index c392a71..a71ba54 100644 --- a/guix-config/packages/emacs.scm +++ b/guix-config/packages/emacs.scm @@ -44,6 +44,7 @@ emacs-cape emacs-vertico emacs-orderless + emacs-zig-mode font-iosevka diff --git a/guix-config/system/base-system.scm b/guix-config/system/base-system.scm index bee9079..8333e64 100644 --- a/guix-config/system/base-system.scm +++ b/guix-config/system/base-system.scm @@ -11,10 +11,7 @@ (define %my-desktop-services (modify-services %desktop-services - (gdm-service-type config => - (gdm-configuration - (inherit config) - (wayland? #t))) + (delete gdm-service-type) (elogind-service-type config => (elogind-configuration (inherit config)