aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2025-12-03 14:07:25 -0800
committerGravatar Tom Willemse2025-12-03 14:07:25 -0800
commit64f126df314514e6792a0f2ffa490fa152890e06 (patch)
tree4579d386873bcf3aeac87c65486c315670c391d5
parent7e6dadd2ec6a328fea19faeaa5b452b7ab500f9c (diff)
downloadnew-dotfiles-64f126df314514e6792a0f2ffa490fa152890e06.tar.gz
new-dotfiles-64f126df314514e6792a0f2ffa490fa152890e06.zip
pop-os: Use ‘home-module’ to cut up configuration a little
I'm trying out abstracting some more of my configuration so it's easier to keep in line with my other machines.
-rw-r--r--oni/home/config/pop-os.scm267
1 files changed, 134 insertions, 133 deletions
diff --git a/oni/home/config/pop-os.scm b/oni/home/config/pop-os.scm
index cf94e79..852ba24 100644
--- a/oni/home/config/pop-os.scm
+++ b/oni/home/config/pop-os.scm
@@ -1,6 +1,6 @@
(define-module (oni home config pop-os)
- #:use-module ((gnu home)
- #:select (home-environment))
+ #:use-module (guix records)
+ #:use-module (gnu home)
#:use-module ((gnu home services gnupg)
#:select (home-gpg-agent-service-type
home-gpg-agent-configuration))
@@ -104,7 +104,137 @@
;; #:select (stumpwm+swank))
#:use-module (oni packages shutdown-rofi))
-(home-environment
+(define-record-type* <home-module> home-module
+ make-home-environment
+ home-module?
+ (packages home-module-packages
+ (default '()))
+ (services home-module-services
+ (default '())))
+
+(define oni-home-zsh-configuration
+ (home-module
+ (services (list home-zsh-service
+ ;; This has to be the first extension because it needs to be added to the
+ ;; configuration last.
+ (service home-zsh-syntax-highlighting-service-type)
+ (service home-zsh-autosuggestions-service-type)
+ (service home-zsh-contextual-abbrevs-service-type)
+ (service home-zsh-atuin-service-type
+ (home-zsh-atuin-configuration
+ (inline-height 20)
+ (filter-mode 'directory)
+ (history-filter
+ '("^ +"))
+ (enter-accept #t)))))))
+
+(define oni-home-herbstluftwm-configuration
+ (home-module
+ (packages (list hlwm-run-or-raise))
+ (services (list
+ (service home-herbstluftwm-service-type
+ (home-herbstluftwm-configuration
+ (tags '(dev web))
+ (key-bindings
+ '(("s-S-q" . "quit")
+ ("s-S-e" . "reload")))
+ (mouse-bindings
+ '(("s-Button1" . "move")
+ ("s-Button2" . "zoom")
+ ("s-Button3" . "resize")))
+ (settings
+ '((default_frame_layout . 2)
+ (frame_border_active_color . "#3d3d3d")
+ (frame_border_normal_color . "#222222")
+ (frame_bg_normal_color . "#111111")
+ (frame_bg_active_color . "#263f1f")
+ (frame_border_width . 0)
+ (window_border_width . 2)
+ (window_border_inner_width . 0)
+ (window_border_normal_color . "#222222")
+ (window_border_active_color . "#1f3f3f")
+ (window_border_inner_color . "#111111")
+ (always_show_frame . 0)
+ (frame_gap . 30)
+ (window_gap . 30)
+ (frame_padding . -30)
+ (frame_bg_transparent . 1)
+ (smart_window_surroundings . 0)
+ (smart_frame_surroundings . 0)
+ (mouse_recenter_gap . 0)
+ (swap_monitors_to_get_tag . 0)
+ (update_dragged_clients . 1)
+ (tree_style . "╾│ ├└╼─┐")))
+ (attributes
+ '(((theme tiling reset) . 1)
+ ((theme floating reset) . 1)))
+ (rules
+ '(("focus=on")
+ ("class=Emacs" "tag=dev" "index=01" "switchtag=on" "hook=emacs")
+ ("class~'URxvt|kitty'" "tag=dev" "index=1" "switchtag=on" "hook=urxvt")
+ ("class~'Conkeror|[Ff]irefox|Chromium'" "tag=web" "index=0" "switchtag=on")
+ ("class=Pinentry" "pseudotile=on")
+ ("class=Alsaplayer" "pseudotile=on")
+ ("class=Gcr-prompter" "pseudotile=on")
+ ("class=Steam" "title='Steam Login'" "pseudotile=on")
+ ("class=Steam" "title~'Steam - News .*'" "pseudotile=on")
+ ("class=" "title=Steam" "pseudotile=on")
+ ("class=xfreerdp" "floating=on" "tag=work" "index=0" "switchtag=on")
+ ("windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)'" "pseudotile=on")
+ ("windowtype='_NET_WM_WINDOW_TYPE_DIALOG'" "focus=on")
+ ("windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)'" "manage=off")
+ ("class=pinball.exe" "pseudotile=on")))
+ (padding '(0 0 0 16 16))
+ (layouts
+ '((web clients max:0)
+ (dev split horizontal:0.7375:1 (clients max:0) (clients vertical:0))))
+ (extra
+ (list
+ (mixed-text-file
+ "autostart"
+ "herbstclient focus_edge left\n"
+ "herbstclient keybind Mod4-apostrophe spawn dunstctl close\n"
+ "herbstclient keybind Mod4-quotedbl spawn dunstctl close-all\n"
+ "herbstclient keybind Mod4-Control-apostrophe spawn dunstctl history-pop\n"
+ "herbstclient keybind Mod4-Mod1-apostrophe spawn dunstctl context\n"
+ "herbstclient spawn pick-random-wallpaper\n")))))
+
+ (service home-sxhkd-service-type
+ (home-sxhkd-configuration
+ (configurations
+ (list (local-file "sxhkdrc")
+ (mixed-text-file
+ "sxhkdrc-playerctl"
+ "XF86AudioPlay\n"
+ " herbstclient spawn " playerctl "/bin/playerctl play-pause\n"
+ "XF86AudioNext\n"
+ " herbstclient spawn " playerctl "/bin/playerctl next\n"
+ "XF86AudioPrev\n"
+ " herbstclient spawn " playerctl "/bin/playerctl prev\n")
+ (mixed-text-file
+ "sxhkdrc-pamixer"
+ "XF86AudioRaiseVolume\n"
+ " herbstclient spawn " pamixer "/bin/pamixer --increase 10\n"
+ "XF86AudioLowerVolume\n"
+ " herbstclient spawn " pamixer "/bin/pamixer --decrease 10\n"
+ "XF86AudioMute\n"
+ " herbstclient spawn " pamixer "/bin/pamixer --toggle-mute\n")))))
+
+ (service home-polybar-service-type
+ (home-polybar-configuration
+ (bar "example")))))))
+
+(define* (home-modules->home-environment #:rest modules)
+ (home-environment
+ (packages
+ (apply append (map home-module-packages modules)))
+ (services
+ (apply append (map home-module-services modules)))))
+
+(home-modules->home-environment
+ oni-home-zsh-configuration
+ oni-home-herbstluftwm-configuration
+ (home-module
(packages (append
foreign-distro-compatibility-packages
(list (specification->package+output "font-fantasque-sans")
@@ -151,7 +281,6 @@
emacs-dired-git-info
emacs-oni-elfeed
- hlwm-run-or-raise
shutdown-rofi
playerctl
pamixer
@@ -201,139 +330,11 @@
(home-emacs-vterm-configuration
(buffer-name-string "*vterm* %s")))
- home-zsh-service
-
- ;; This has to be the first extension because it needs to be added to the
- ;; configuration last.
- (service home-zsh-syntax-highlighting-service-type)
- (service home-zsh-autosuggestions-service-type)
- (service home-zsh-contextual-abbrevs-service-type)
- (service home-zsh-atuin-service-type
- (home-zsh-atuin-configuration
- (inline-height 20)
- (filter-mode 'directory)
- (history-filter
- '("^ +"))
- (enter-accept #t)))
-
- ;; (service home-stumpwm-service-type
- ;; (home-stumpwm-configuration
- ;; (package stumpwm+swank)
- ;; (locker-program "/usr/bin/i3lock")
- ;; (configurations
- ;; (list (local-file "../services/stumpwm/stumpwm.lisp")
- ;; (local-file "../services/stumpwm/pop-os-config.lisp")))))
- ;; (service home-stumpwm-stumptray-service-type
- ;; (home-stumpwm-stumptray-configuration
- ;; (configurations
- ;; (list (mixed-text-file "config-stumptray"
- ;; "(require 'stumptray)\n"
- ;; "(stumptray::stumptray)\n")))))
- ;; (service home-stumpwm-playerctl-service-type
- ;; (home-stumpwm-playerctl-configuration
- ;; (configurations
- ;; (list (local-file "../services/stumpwm/playerctl.lisp")))))
- ;; (service home-stumpwm-pamixer-service-type
- ;; (home-stumpwm-pamixer-configuration
- ;; (configurations
- ;; (list (local-file "../services/stumpwm/pamixer.lisp")))))
-
(service home-flameshot-service-type)
(service home-mbsync-service-type)
- (service home-herbstluftwm-service-type
- (home-herbstluftwm-configuration
- (tags '(dev web))
- (key-bindings
- '(("s-S-q" . "quit")
- ("s-S-e" . "reload")))
- (mouse-bindings
- '(("s-Button1" . "move")
- ("s-Button2" . "zoom")
- ("s-Button3" . "resize")))
- (settings
- '((default_frame_layout . 2)
- (frame_border_active_color . "#3d3d3d")
- (frame_border_normal_color . "#222222")
- (frame_bg_normal_color . "#111111")
- (frame_bg_active_color . "#263f1f")
- (frame_border_width . 0)
- (window_border_width . 2)
- (window_border_inner_width . 0)
- (window_border_normal_color . "#222222")
- (window_border_active_color . "#1f3f3f")
- (window_border_inner_color . "#111111")
- (always_show_frame . 0)
- (frame_gap . 30)
- (window_gap . 30)
- (frame_padding . -30)
- (frame_bg_transparent . 1)
- (smart_window_surroundings . 0)
- (smart_frame_surroundings . 0)
- (mouse_recenter_gap . 0)
- (swap_monitors_to_get_tag . 0)
- (update_dragged_clients . 1)
- (tree_style . "╾│ ├└╼─┐")))
- (attributes
- '(((theme tiling reset) . 1)
- ((theme floating reset) . 1)))
- (rules
- '(("focus=on")
- ("class=Emacs" "tag=dev" "index=01" "switchtag=on" "hook=emacs")
- ("class~'URxvt|kitty'" "tag=dev" "index=1" "switchtag=on" "hook=urxvt")
- ("class~'Conkeror|[Ff]irefox|Chromium'" "tag=web" "index=0" "switchtag=on")
- ("class=Pinentry" "pseudotile=on")
- ("class=Alsaplayer" "pseudotile=on")
- ("class=Gcr-prompter" "pseudotile=on")
- ("class=Steam" "title='Steam Login'" "pseudotile=on")
- ("class=Steam" "title~'Steam - News .*'" "pseudotile=on")
- ("class=" "title=Steam" "pseudotile=on")
- ("class=xfreerdp" "floating=on" "tag=work" "index=0" "switchtag=on")
- ("windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)'" "pseudotile=on")
- ("windowtype='_NET_WM_WINDOW_TYPE_DIALOG'" "focus=on")
- ("windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)'" "manage=off")
- ("class=pinball.exe" "pseudotile=on")))
- (padding '(0 0 0 16 16))
- (layouts
- '((web clients max:0)
- (dev split horizontal:0.7375:1 (clients max:0) (clients vertical:0))))
- (extra
- (list
- (mixed-text-file
- "autostart"
- "herbstclient focus_edge left\n"
- "herbstclient keybind Mod4-apostrophe spawn dunstctl close\n"
- "herbstclient keybind Mod4-quotedbl spawn dunstctl close-all\n"
- "herbstclient keybind Mod4-Control-apostrophe spawn dunstctl history-pop\n"
- "herbstclient keybind Mod4-Mod1-apostrophe spawn dunstctl context\n"
- "herbstclient spawn pick-random-wallpaper\n")))))
-
- (service home-sxhkd-service-type
- (home-sxhkd-configuration
- (configurations
- (list (local-file "sxhkdrc")
- (mixed-text-file
- "sxhkdrc-playerctl"
- "XF86AudioPlay\n"
- " herbstclient spawn " playerctl "/bin/playerctl play-pause\n"
- "XF86AudioNext\n"
- " herbstclient spawn " playerctl "/bin/playerctl next\n"
- "XF86AudioPrev\n"
- " herbstclient spawn " playerctl "/bin/playerctl prev\n")
- (mixed-text-file
- "sxhkdrc-pamixer"
- "XF86AudioRaiseVolume\n"
- " herbstclient spawn " pamixer "/bin/pamixer --increase 10\n"
- "XF86AudioLowerVolume\n"
- " herbstclient spawn " pamixer "/bin/pamixer --decrease 10\n"
- "XF86AudioMute\n"
- " herbstclient spawn " pamixer "/bin/pamixer --toggle-mute\n")))))
- (service home-polybar-service-type
- (home-polybar-configuration
- (bar "example")))
-
(service home-gpg-agent-service-type
(home-gpg-agent-configuration
(ssh-support? #t)
(extra-content
- "allow-emacs-pinentry\n"))))))
+ "allow-emacs-pinentry\n")))))))