¶News
Celebrating One Year of the Craftering!
Shom’s post: https://shom.dev/posts/20250401_how-i-accidentally-got-better-at-self-hosting-and-foss-contributing/ Glenn’s post: https://glenneth.org/content/posts/2025-04-04-one-year-of-craftering.html
If you want to join head over to https://craftering.systemcrafters.net
The Spring Lisp Game Jam is almost here! May 9th - May 19th
New Guix Course in Development
System Crafters Guild members at 15/mo and above will have early access to in-development course material while I’m working on it (on the Forum).
Join the Guild here: https://systemcrafters.store
¶A Guix Home Service for Sway
Today we’ll take a look at a “new” Guix Home service for configuring Sway!
¶The final configuration
Here’s the configuration we built:
(use-modules (ice-9 match) (gnu) (gnu home services) (gnu home services sway)) (use-package-modules compression curl fonts freedesktop gimp glib gnome gnome-xyz gstreamer kde-frameworks linux music package-management password-utils pdf pulseaudio shellutils ssh syncthing terminals video web-browsers wget wm xdisorg xorg) (define (make-primary-outputs identifiers) (map (lambda (identifier) (sway-output (identifier identifier) (extra-content '("scale 2")))) identifiers)) (define workspace-list '((ws0 "0" "$laptop") (ws2 "2" "$primary $laptop") (ws3 "3" "$laptop") (ws4 "4" "$laptop") (ws5 "5" "$laptop") (ws1 "1" "$primary $laptop"))) (define* (my-sway-config #:key (primary-outputs '("DP-1")) (bg-path "~/.dotfiles/backgrounds/samuel-ferrara-uOi3lg8fGl4-unsplash.jpg")) (service home-sway-service-type (sway-configuration (variables (append `((laptop . "eDP-1") (primary . ,(string-join primary-outputs " "))) (map (match-lambda ((ws num _) (cons ws num))) workspace-list) %sway-default-variables)) (extra-content `("font pango:JetBrains Mono 7" "floating_modifier $mod" ,@(map (match-lambda ((ws num outputs) (format #f "workspace $~a output ~a" ws outputs))) workspace-list))) (outputs (append (make-primary-outputs primary-outputs) (list (sway-output (identifier 'eDP-1) (position (point (x 1920) (y 135))) (extra-content '("scale 2"))) (sway-output (identifier '*) (background `(,bg-path . fill)))))) (inputs (list (sway-input (identifier "type:keyboard") (layout (keyboard-layout "us,gr" #:options '("ctrl:nocaps")))) (sway-input (identifier "type:touchpad") (tap #t) (disable-while-typing #t) (extra-content '("middle_emulation enabled"))))) (gestures '()) (keybindings `(($mod+Shift+q . "kill") ($mod+Shift+x . "exit") ($mod+Shift+r . "reload") ($mod+Mod1+h . "move workspace to output left") ($mod+Mod1+l . "move workspace to output right") ($mod+f . "fullscreen toggle") ($mod+Shift+f . "floating toggle") ($mod+Shift+p . "sticky toggle") ($mod+Control+space . "focus mode_toggle") ($mod+space . ,#~(string-append "exec " #$fuzzel "/bin/fuzzel" " -w 50 -x 8 -y 8 -r 3 -b 232635ff -t A6Accdff -s A6Accdff -S 232635ff -C c792eacc -m c792eacc -f \"JetBrains Mono:weight=light:size=10\" --icon-theme=\"Papirus-Dark\" --no-exit-on-keyboard-focus-loss")))) (startup-programs '()) (packages (list swayidle swaylock fuzzel wl-clipboard mako foot gammastep grimshot ;; grimshot --notify copy area network-manager-applet))))) (home-environment (services (list (my-sway-config #:primary-outputs '("DP-1" "DP-2")))))
I was testing it out using the following command:
guix home container sway-demo.scm -- cat .config/sway/config