Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Full Guix Config

Introduction

This document will contain literate config of literally all my guix config, which will be tangled within $HOME/.config/guix Direcories

Channel Config

the added channels are:

  • Nonguix
  • Personal
  • guix-science
    (cons* (channel
            (name 'nonguix)
            (url "https://gitlab.com/nonguix/nonguix")
            ;; Enable signature verification:
            (introduction
             (make-channel-introduction
              "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
              (openpgp-fingerprint
               "2A39 3FFF 68F4 EF7A 3D29  12AF 6F51 20A0 22FB B2D5"))))
           (channel
            (name 'guix-science)
            (url "https://codeberg.org/guix-science/guix-science.git")
            (branch "master")
            (introduction
             (make-channel-introduction
              "b1fe5aaff3ab48e798a4cce02f0212bc91f423dc"
              (openpgp-fingerprint
               "CA4F 8CF4 37D7 478F DA05  5FD4 4213 7701 1A37 8446"))))
           (channel
    	(name 'personal)
    	(url "https://github.com/ujwacha/GuixChannel.git")
    	(branch "main"))
           %default-channels)
        

System Config

Modules Import

Firstly import all the things required modules, this part is a bit ugly, i’ll make it good later

(use-modules (gnu) 
	     (gnu system nss)
	     (gnu system accounts)
	     (gnu packages ncurses)
	     (nongnu packages linux)
	     (nongnu packages firmware)
	     (nongnu system linux-initrd)
	     (nongnu packages video))


(use-package-modules audio
		     video
		     nfs
		     certs
		     shells
		     ssh
		     linux
		     bash
		     emacs
		     gnome
		     gnome-xyz
		     emacs-xyz
                     networking
		     wm
		     containers
		     fonts
		     libusb
		     cups
		     databases
		     freedesktop
		     file-systems
                     version-control
		     package-management
		     vim
		     virtualization
		     docker
		     wm)

(use-service-modules dbus
		     desktop
		     ssh
		     cups
		     pm
		     authentication
		     xorg
		     containers
		     databases
		     sound
		     web
		     virtualization
		     docker
		     networking)

(use-package-modules bootloaders
		     ratpoison
		     suckless
		     wm
		     glib
		     xorg)

Operating system definition

(operating-system
 (host-name "vogel")
 (timezone "Asia/Kathmandu")
 (locale "en_US.utf8")

 (kernel linux)

 (initrd microcode-initrd)

 (firmware (list linux-firmware
		 sof-firmware))

 (kernel-arguments (append '("resume=607f7910-12e6-404f-8664-70fa0c0f8776")
			   %default-kernel-arguments))
 
 <<bootloader>>
 <<file-systems>>
 <<swap-devices>>

 <<users>>

 <<system-packages>>

 <<system-services>>
 
 (name-service-switch %mdns-host-lookup-nss))

Bootloader

just install grub bootloader in standard place

(bootloader (bootloader-configuration
             (bootloader grub-efi-bootloader)
             (targets '("/boot/efi"))))

file systems

this is how we add filesystems

(file-systems (append
	       (list
		<<fs-root>>
		
		<<fs-home>>
		
		<<fs-snapshots>>
		
		<<fs-gnu-store>>
		
		<<fs-boot>>
		)
	       %base-file-systems))

Root

(file-system
 (mount-point "/")
 (type "btrfs")
 (device
  (uuid "92b39d97-81c5-4ef5-ba2f-51600140f500"))
 (options "subvol=@,compress=zstd,discard=async,space_cache=v2"))

Home

(file-system
 (mount-point "/home")
 (type "btrfs")
 (device
  (uuid "92b39d97-81c5-4ef5-ba2f-51600140f500"))
 (options "subvol=@home,compress=zstd,discard=async,space_cache=v2"))

Snapshots

(file-system
 (mount-point "/.snapshots")
 (type "btrfs")
 (device
  (uuid "92b39d97-81c5-4ef5-ba2f-51600140f500"))
 (options "subvol=@snapshots,compress=zstd,discard=async,space_cache=v2"))

GNU Store

(file-system
 (mount-point "/gnu/store")
 (type "btrfs")
 (device
  (uuid "92b39d97-81c5-4ef5-ba2f-51600140f500"))
 (options "subvol=@store,compress=zstd,discard=async,space_cache=v2"))

Boot

(file-system
 (device (uuid "EAA5-790E" 'fat))
 (mount-point "/boot/efi")
 (type "vfat"))

Swap

(swap-devices 
  (list
   (swap-space (target 
		(uuid "607f7910-12e6-404f-8664-70fa0c0f8776")))))

Users and Groups

(groups (cons* ;; (user-group (name "libvirt"))
	       ;; (user-group (name "cgroup"))
               %base-groups))

(users (append (list
		<<user-light>>
		<<user-studyonly>>
		)
	       %base-user-accounts))

User Light

This is my main user

(user-account
 (name "light")
 (comment "Main User")
 (group "users")
 (supplementary-groups '("wheel" "netdev"
			 "audio" "video"
			 "dialout" "libvirt"
			 "kvm" "cgroup"
			 "docker")))

User Studyonly

(user-account
 (name "study")
 (comment "Study User")
 (group "users")
 (supplementary-groups '("wheel" "netdev"
			 "audio" "video"
			 "dialout")))

Packages

In the main system, there’s not going to be a bunch of packages so we’ll just put them in a single code block, I know It’s kinda ugly, but that’s the best we can do

(packages (append (list
		   fwupd-nonfree
		   i3-wm i3status dmenu i3blocks
		   xterm
		   ncurses
		   dbus
		   bluez
                   bluez-alsa
                   brightnessctl
                   exfat-utils
                   fuse-exfat
                   git
                   gvfs ;; Enable user mounts
                   intel-media-driver/nonfree
                   libva-utils
                   ntfs-3g
                   stow
                   vim
		   swaylock
		   swayidle
		   sway
		   xdg-dbus-proxy
		   xdg-desktop-portal
		   xdg-desktop-portal-gtk
		   xdg-desktop-portal-wlr
		   mako
		   niri
		   gnome-shell-extension-vitals
		   gnome-shell-extension-gsconnect
		   gnome-shell-extension-just-perfection
		   gnome-shell-extension-paperwm
		   gnome-shell-extension-appindicator
		   distrobox
		   docker
		   qemu
		   virt-manager
		   tlp
		   podman
		   ;;power-profiles-daemon
		   )
		  %base-packages))

Services

(services
 (append (list
	  <<system-openssh-service>>
	  <<system-cups-service>>
	  <<system-tlp-service>>
	  <<system-thermald-service>>
	  <<system-sql-service>>
	  <<system-bluetooth-service>>
	  <<system-screen-locker>>
	  <<system-libvirt>>
	  <<system-fwupd>>
	  <<system-podman>>
	  <<system-docker>>
	  )
	 
	 <<modified-system-desktop-services>>
	 ))

Openssh

(service openssh-service-type)

Cups

This is for printing stuff, to connect to printers basically

(service gnome-desktop-service-type)
(service cups-service-type)

TLP

TLP manages Power that goes into my laptop

(service tlp-service-type
  (tlp-configuration
    (tlp-enable? #t)
    (tlp-default-mode "AC")
    (start-charge-thresh-bat0 84)
    (stop-charge-thresh-bat0 94)
    
    (cpu-scaling-governor-on-ac '("performance"))
    (cpu-scaling-governor-on-bat '("powersave"))
    (cpu-energy-perf-policy-on-ac "performance")
    (cpu-energy-perf-policy-on-bat "power")
    
    (cpu-scaling-max-freq-on-ac 4200000)
    (cpu-scaling-max-freq-on-bat 900000)
    
    (cpu-boost-on-ac? #t)
    (cpu-boost-on-bat? #f)
  ))

(extra-special-file
 "/etc/tlp.d/50-platform-profile.conf"
 (plain-file "50-platform-profile.conf"
             "PLATFORM_PROFILE_ON_AC=performance\nPLATFORM_PROFILE_ON_BAT=low-power\nCPU_HWP_DYN_BOOST_ON_AC=1\nCPU_HWP_DYN_BOOST_ON_BAT=0\n"))

ThermalD

(service thermald-service-type)

Bluetooth

(service bluetooth-service-type
         (bluetooth-configuration
          (auto-enable? #t)))

SQL

(service postgresql-service-type
         (postgresql-configuration
          (postgresql postgresql)))

System Screen Locker enable for Sway

(service screen-locker-service-type
	 (screen-locker-configuration
	  (name "swaylock")
	  (program (file-append swaylock "/bin/swaylock"))))

Libvirt

(service libvirt-service-type)
(service virtlog-service-type)

Fwupd

(simple-service 'dbus-fwupd dbus-root-service-type 
                (list fwupd-nonfree))
(simple-service 'polkit-fwupd polkit-service-type 
                (list fwupd-nonfree))

Podman

(service iptables-service-type)

(service rootless-podman-service-type
         (rootless-podman-configuration
          (subuids (list (subid-range (name "light"))))
          (subgids (list (subid-range (name "light"))))))

Docker

(service containerd-service-type)
(service docker-service-type)

Modified Desktop Services

(modify-services
 %desktop-services
 
 (guix-service-type config =>
		    (guix-configuration
		     (inherit config)
		     (substitute-urls 
		      (append
		       (list
			"https://bordeaux-singapore-mirror.cbaines.net"
			"https://guix.bordeaux.inria.fr"
			"https://substitutes.nonguix.org"
			)
		       %default-substitute-urls

		       ))
		     (authorized-keys
		      (append
		       (list (local-file "./signing-key.pub")
			     (local-file "./guix-sci-key.pub"))
		       %default-authorized-guix-keys)))))

Home Config

Home Modules Import

(use-modules (gnu home)
             (gnu packages)
             (gnu services)
             (guix gexp)
             (gnu home services shells)
	     (gnu home services desktop)
	     (gnu home services sway)
	     (gnu home services pm)
	     (gnu home services sound)
	     (gnu home services)
	     (gnu services databases)
             (gnu home services shepherd)
	     (my services i3blocks)
	     
	     (gnu packages wm)
	     (gnu packages cpp)
	     (gnu packages gdb)
	     (gnu packages embedded)
	     (gnu packages databases)
	     (gnu packages python-build)
	     (gnu packages pulseaudio)
	     (gnu packages electronics)
	     (gnu packages video)
	     (gnu packages engineering)
	     (gnu packages graphics)
	     (gnu packages package-management)
	     (gnu packages bittorrent)
	     (gnu packages gnome)
	     (gnu packages antivirus)
	     (gnu packages libreoffice)
	     (gnu packages image)
	     (gnu packages emulators)
	     (gnu packages chromium)
	     (gnu packages gnome-xyz)
	     (gnu packages xorg)
	     (gnu packages shellutils)
	     (gnu packages vim)
	     (gnu packages lisp)
	     (gnu packages text-editors)
	     (gnu packages terminals)
	     (gnu packages maths)
	     (gnu packages compression)
	     (gnu packages algebra)
	     (gnu packages linux)
	     (gnu packages freedesktop)
	     (gnu packages containers)
	     (gnu packages password-utils)
	     (gnu packages pkg-config)
	     (gnu packages autotools) 
	     (gnu packages build-tools)
	     (gnu packages cmake)
	     (gnu packages base)
	     (gnu packages gtk)
	     (gnu packages commencement)
	     (gnu packages llvm)
	     (gnu packages python)
	     (gnu packages python-xyz)
	     (gnu packages rust)
	     (gnu packages rust-apps)
	     (gnu packages xdisorg)
	     (gnu packages admin)
	     (gnu packages java)
	     (gnu packages sqlite)
	     (gnu packages python-science)
	     (gnu packages duckdb)
	     (gnu packages web)
	     (gnu packages docker)
	     (gnu packages tex)
	     (gnu packages file-systems)
	     (gnu packages emacs)
	     (gnu packages emacs-xyz)
	     (gnu packages fonts)
	     (gnu system keyboard)      ;; Required for keyboard-layout
	     (gnu packages xdisorg)    ;; For swaylock, wl-clipboard
	     (nongnu packages emacs)
	     (nongnu packages fonts)
	     (nongnu packages mozilla)
	     (nongnu packages chrome)
	     (nonguix multiarch-container)
	     (guix-science packages electronics)
	     )

Package Definitions

SQL packages

(define sql-packages-list
  (list sqlite
	postgresql
	sqlitebrowser
	pgloader
	python-psycopg2
	python-sqlalchemy
	python-pandas
	duckdb
	redis
	jq))

Emacs Packages

(define my-emacs-package-list
  (list emacs-pgtk
	emacs-use-package
	emacs-envrc
	emacs-helm
	emacs-forge
	emacs-pdf-tools
	emacs-htmlize
	emacs-lsp-mode
	emacs-lsp-ui
	emacs-lsp-ivy
	emacs-lsp-treemacs
	emacs-guix
	emacs-gcmh
	emacs-ivy
	emacs-sly
	emacs-sly-asdf
	emacs-swiper
	emacs-php-mode
	emacs-doom-modeline
	emacs-all-the-icons
	emacs-spacemacs-theme
	emacs-doom-themes
	emacs-rainbow-delimiters 
	emacs-which-key
	emacs-ivy-rich
	emacs-counsel
	emacs-undo-tree
	emacs-company
	emacs-yasnippet
	emacs-vterm
	emacs-vhdl-ext
	emacs-multi-vterm
	emacs-beacon
	emacs-neotree
	emacs-helpful
	emacs-markdown-mode
	emacs-simple-httpd
	emacs-elfeed
	emacs-projectile
	emacs-web-mode
	emacs-typescript-mode
	emacs-flycheck
	emacs-magit
	emacs-mkmcc-gnuplot-mode
	emacs-gnuplot
	emacs-rainbow-mode
	emacs-all-the-icons-dired
	emacs-emms
	emacs-dirvish
	emacs-drag-stuff
	emacs-multiple-cursors
	emacs-expand-region
	emacs-golden-ratio
	emacs-pyvenv
	emacs-mentor
	emacs-auctex
	emacs-org
	emacs-org-bullets
	emacs-org-roam
	emacs-org-roam-ui
	emacs-gptel
	emacs-dashboard
	emacs-visual-fill-column
	emacs-org-pdftools
	emacs-ox-reveal
	emacs-org-download
	emacs-org-fragtog
	emacs-flycheck-rust
	emacs-rustic
	emacs-counsel-projectile
	emacs-request
	emacs-djvu
	emacs-nov-el
	emacs-geiser
	emacs-geiser-guile
	emacs-paredit
	emacs-macrostep
	emacs-macrostep-geiser))

Compiler Toolchains

(define compiler-toolchain
  (list pkg-config
	libtool
	autoconf
	automake
	cmake
	gcc-toolchain
	(make-arm-none-eabi-toolchain-12.3.rel1)
	(make-gdb-arm-none-eabi)
	openocd
	clang-toolchain
	coreutils
	glibc
	gnu-make
	c2ffi
	bear
	gdb
	python
	python-lsp-server
	rust
	(list rust "cargo")
	(list rust "rust-src")
	(list rust "tools")
	sbcl
	vhdl-ls
	python-pip
	rust-analyzer))

Fonts

(define useful-fonts
  (list font-hack
        font-google-roboto
        font-google-noto
        font-dejavu
        font-liberation
        font-microsoft-web-core-fonts
        font-microsoft-webdings
        font-wqy-zenhei
        font-wqy-microhei
        font-google-noto-emoji
        font-adobe-source-han-serif
        font-adobe-source-han-sans
        font-gnu-freefont
        font-awesome
        font-cica))

Fun Programs

(define fun-programs
  (list htop
	vlc
	flatpak
	transmission
	transmission-remote-gtk
	rtorrent
	neofetch
	gnome-tweaks
	vim
	fzf
	zip
	unzip
	ghdl-llvm
	firefox
	blender
	freecad
	fastfetch
	clamav
	;;ungoogled-chromium
	google-chrome-stable
	thinkfan
	octave
	bc
	acpi
	xdg-user-dirs
	netcat
	gnome-shell-extensions
	pavucontrol
	pamixer
	libreoffice
	alsa-utils
	libnotify
	gnuplot
	foot
	grim
	slurp
	yt-dlp
	eden
	direnv
	kitty
	lem
	kanata
	keepassxc
	gtkwave
	dragon-drop
	bibata-cursor-theme
	xcursor-themes))

Virtualization and Containers

(define virt-packages
  (list crun
	xhost
	fuse-overlayfs))

Specification packages

These must be put on in the future

(define spec-packages 
  (specifications->packages (list "okular"
                                  "img2pdf"
                                  "cmatrix"
                                  "blueman"
                                  "bluez"
                                  "zathura-pdf-mupdf"
                                  "zathura-pdf-poppler"
                                  "zathura"
                                  "kigo"
                                  "osqp"
                                  "wf-recorder"
                                  "ispell"
                                  "sxiv"
                                  "emacs-gnuplot"
                                  "alacritty"
                                  "ani-cli"
                                  "wofi"
                                  "rust:cargo"
				  "kdenlive"
                                  "slurp"
                                  "grim"
				  "flex"	
				  "bison"
				  "fuse"
				  "elfutils"
				  "openssl"
				  "pkg-config"
                                  "kicad"
                                  "mpv"
                                  "nwg-launchers"
                                  "alsa-utils"
                                  "pamixer"
                                  "libnotify"
                                  "fyi"
                                  "pavucontrol"
                                  "rofi"
                                  "tree"
                                  "quassel"
                                  "irssi"
				  "steam"
                                  "file"
                                  "guix-backgrounds"
                                  "lm-sensors"
                                  "ranger")))

Home Services

Bash Configuration Service

(service home-bash-service-type
         (home-bash-configuration
          (bash-profile (list (local-file ".//.bash_profile" "bash_profile")
                              (plain-file "flatpak-path-fix"
                                          "source ~/.guix-home/profile/etc/profile.d/flatpak.sh")))
          (aliases '(("ls" . "ls --color=auto")
                     ("grep" . "grep --color=auto")
                     ("ll" . "ls -alF")
                     ("gcon" . "cd ~/.config/guix/")
		     ("ros" . "distrobox enter ros-jazzy")))
          (bashrc (list
		   (plain-file "bashrc-integrated"
			       "
# 1. External Hooks
eval \"$(fzf --bash)\"
eval \"$(direnv hook bash)\"

#export DBX_CONTAINER_MANAGER=\"docker\"

# 2. Refined Guix Indicator Function
get_guix_indicator() {
    # Direct guix shell environment
    if [ -n \"$GUIX_ENVIRONMENT\" ]; then
        echo -ne \"\\001\\033[01;35m\\002[Guix]\\001\\033[00m\\002\"
        return
    fi
    
    # Check for direnv-loaded guix environment
    if [ -n \"$DIRENV_DIR\" ]; then
        # Check multiple possible indicators
        if [[ \"$PATH\" == *\"/gnu/store/\"* ]] || \\
           [[ \"$GUIX_PYTHONPATH\" == *\"/gnu/store/\"* ]] || \\
           [[ \"$PKG_CONFIG_PATH\" == *\"/gnu/store/\"*\"-profile/\"* ]] || \\
           [[ \"$CPLUS_INCLUDE_PATH\" == *\"/gnu/store/\"* ]] || \\
           [[ -n \"$GUIX_LOCPATH\" ]]; then
            echo -ne \"\\001\\033[01;35m\\002[Guix]\\001\\033[00m\\002\"
        fi
    fi
}

# 3. Final PS1
export PS1='\\001\\033[0m\\002┌─\\001\\033[01;34m\\002[\\u@\\h]\\001\\033[00m\\002$(get_guix_indicator) - \\001\\033[01;33m\\002[\\w]\\001\\033[00m\\002 - \\001\\033[01;32m\\002[\\!]\\001\\033[00m\\002\\n└─\\001\\033[01;31m\\002[\\$]\\001\\033[00m\\002 '
")
		   ))))

Files Service

(service home-files-service-type
	 (list `(".inputrc"
		 ,(plain-file "inputrc"
			      "\"\\t\": menu-complete\n\"\\e[Z\": menu-complete-backward\nset colored-stats on\nset menu-complete-display-prefix on\n\n\"\\e[A\": history-search-backward\n\"\\e[B\": history-search-forward\n"
			      ))))

Environment Variables Service

(simple-service 'my-environment-variables
		home-environment-variables-service-type
		`(("PATH" . ,(string-append (getenv "HOME") "/.local/bin:" "$PATH"))
		  ("PICO_SDK_PATH" . ,(string-append (getenv "HOME") "/Desktop/dev_ws/src/pico-sdk/"))
		  ("MOZ_ENABLE_WAYLAND" . "1")
		  ("XCURSOR_THEME" . "Bibata-Original-Classic")
		  ("XCURSOR_SIZE" . "22")
		  ))


(simple-service 'bibata-manual-config
                home-xdg-configuration-files-service-type
                `(("gtk-3.0/settings.ini"
                   ,(plain-file "settings.ini"
                                "[Settings]\ngtk-cursor-theme-name=Bibata-Modern-Ice\ngtk-cursor-theme-size=24"))
                  ("gtk-4.0/settings.ini"
                   ,(plain-file "settings.ini"
                                "[Settings]\ngtk-cursor-theme-name=Bibata-Modern-Ice\ngtk-cursor-theme-size=24"))))

i3blocks Service

This is the configuration list

(define my-i3blocks-configlist
  '(
    (NETWORK
     (command . "~/.scripts/which-net.sh")
     (interval . 2))
    
    (DISK
     (command . "df -h / | awk '/\\//{ printf(\" 💾 %4s/%s \\n\", $4, $2) }'")
     (interval . 10)
     (color . (201 227 219)))
    
    (BATTERY
     (command . "~/.scripts/battery-percentage.sh")
     (interval . 3))

    (FAN
     (command . "~/.scripts/fan-speed.sh")
     (interval . 3)
     (color . (254 201 37)))
    
    (CPU
     (command . "~/.scripts/cpu-freq-percentage.sh")
     (interval . 1)
     (color . (0 255 128)))

    (MEM
     (command . "free -h | awk '/Mem:/ { printf(\" 🐏 %5s/%s \\n\", $3, $2) }'")
     (interval . 1)
     (color . (254 201 37)))
    
    (SOUND
     (command . "~/.config/i3blocks/sound/sound_info.sh")
     (interval . 5)
     (signal . 10))

    (TIME_DATE
     (command . "date +\" %a, %d %b - %H:%M:%S\"")
     (interval . 1))))
(service home-i3blocks-service-type my-i3blocks-configlist)

Battery low service

Hibernate should work for this

(service home-batsignal-service-type
        (home-batsignal-configuration
          (danger-level 15)
          (danger-command "loginctl hibernate")
          (poll-delay 60)))

Pipewire

(service home-pipewire-service-type)

D-Bus Service

(service home-dbus-service-type)

Main Home Environment Definition

this is the main home environment definition, make sure that it does not have a goddamn name

<<my-i3blocks-config>>

<<sql-packages-list>>

<<my-emacs-package-list>>

<<useful-fonts>>

<<compiler-toolchain>>

<<fun-programs>>

<<virt-programs>>
<<home-spec-packages>>

<<sway-unity-theme>>

(home-environment
 (packages
  (append
   sql-packages-list
   (list texlive-scheme-basic)
   my-emacs-package-list
   useful-fonts
   compiler-toolchain
   fun-programs
   virt-packages
   spec-packages
   ))

 (services
  (append (list
	   
	   <<home-bash-service>>
	   
	   <<home-files-service>>
	   
	   <<home-env-vars-service>>
	   
	   <<home-i3blocks-service>>
	   
	   <<home-sway-configuration>>
	   
	   <<home-dbus-service>>

	   <<battery-low-service>>

	   <<home-pipewire>>
	   )
	  %base-home-services)))

Sway Configuration

In this section, I will configure sway using guile scheme

(service home-sway-service-type
	 (sway-configuration
	   <<sway-variables>>
	   <<sway-packages>>
	   <<sway-inputs>>
	   <<sway-outputs>>
	   <<sway-gestures>>
	   <<sway-keybindings>>
	   <<sway-bar>>
	   <<sway-colors>>
	   <<sway-startup>>
	   ))

Unity Theme

(define unity-orange
  (sway-border-color (border "#DD4814") (background "#DD4814") (text "#FFFFFF")))

(define unity-dark
  (sway-border-color (border "#2C2C2C") (background "#2C2C2C") (text "#AFAFAF")))

(define unity-neutral
  (sway-border-color (border "#3E3E3E") (background "#3E3E3E") (text "#DCDCDC")))

(define unity-urgent
  (sway-border-color (border "#DF382C") (background "#DF382C") (text "#FFFFFF")))

Variables

(variables (append '((alt . "Mod1"))
		   %sway-default-variables))

Packages

(packages
 (append (list swaylock
	       wl-clipboard
	       i3blocks)
	 %sway-default-packages))

Inputs

Use result from this code block to find out about the inputs

swaymsg -t get_inputs
(inputs
 (list 
  (sway-input (identifier "2:7:SynPS/2_Synaptics_TouchPad")
	      (disable-while-typing #t)
	      (disable-while-trackpointing #t)
	      (tap #t)
	      (extra-content '("natural_scroll enabled"
			       "middle_emulation enabled"
			       "pointer_accel 0.5"
			       "scroll_factor 2.0")))
  
  (sway-input (identifier "2:10:TPPS/2_Elan_TrackPoint")
	      (extra-content '("pointer_accel 1.0")))

  (sway-input (identifier "type:keyboard")
	      (layout
	       (keyboard-layout "us" #:options '("ctrl:swapcaps")))
	      (extra-content '("repeat_rate 70")))))

Outputs

Use result from this code block to find out about the outputs

swaymsg -t get_outputs
(outputs
 (list (sway-output
        (identifier '*)
        (background "~/.config/sway/wall"))
       
       (sway-output
	(identifier "HDMI-A-1")
	(position (point (x 1920)
			 (y 1080)))
	(resolution "1920x1080@60Hz"))
       
       (sway-output
	(identifier "eDP-1")
	(position (point (x 0)
			 (y 0)))
	(resolution "1920x1080@60Hz"))))

Gestures

(gestures  '((swipe:3:left . "workspace next_on_output")
	     (swipe:3:right    "workspace prev_on_output" . ("exact"))
	     (swipe:3:down . "move to scratchpad")
	     (swipe:3:up   . "scratchpad show")))

Keybindings

(keybindings
 `(
   <<user-sway-keybinds>>
   <<media-keys-bindings>>
   <<sway-default-keys>>
   )
 )

Default Window Management Keybindings

($mod+shift+return . "exec emacsclient -c")
($mod+g . "exec bash /home/light/.qolscripts/lsqol.sh")
($mod+Shift+d . "exec /home/light/.qolscripts/emacs_dired.sh")
($mod+Mod1+$left . "resize shrink width 50px")
($mod+Mod1+$down . "resize grow height 50px")
($mod+Mod1+$up . "resize shrink height 50px")
($mod+Mod1+$right . "resize grow width 50px")
;;(Mod1+Tab . "exec /home/light/.qolscripts/switchwindow.sh")
($alt+Tab . "exec rofi -i -show window -show-icons")
($mod+u . "exec rofi -i -show drun -show-icons")
($mod+semicolon . "workspace prev")
($mod+slash . "exec /home/light/.scripts/sway_workspace_change.sh i")
($mod+Next . "exec /home/light/.scripts/sway_workspace_change.sh i")
($mod+apostrophe . "workspace next")
($mod+period . "exec /home/light/.scripts/sway_workspace_change.sh d")
($mod+Prior . "exec /home/light/.scripts/sway_workspace_change.sh d")
($mod+Tab . "workspace back_and_forth")
($mod+Shift+semicolon . "move container to workspace prev")
($mod+Shift+slash . "exec /home/light/.scripts/sway_workspace_move.sh i")
($mod+Shift+apostrophe . "move container to workspace next")
($mod+Shift+period . "exec /home/light/.scripts/sway_workspace_move.sh d")
($mod+Shift+Tab . "move container to workspace back_and_forth")
($mod+f . "exec firefox")
($mod+Mod1+q . "exec ~/.scripts/kill_focused_window.sh")
($mod+Shift+s . "sticky toggle")
(Print . "exec grim -g \"$(slurp -d)\" - | wl-copy")

Media Keys Keybinds

(XF86AudioRaiseVolume . "exec --no-startup-id bash ~/.scripts/volctrl i")
(XF86AudioLowerVolume . "exec --no-startup-id bash ~/.scripts/volctrl d")
(XF86AudioMute . "exec --no-startup-id bash ~/.scripts/volctrl p")
(XF86AudioMicMute . "exec --no-startup-id pactl set-source-mute 0 toggle")
(XF86MonBrightnessUp . "exec brightnessctl set 5%+")
(XF86MonBrightnessDown . "exec brightnessctl set 5%-")

Default Sway Keybindings

($mod+Return . "exec $term")
($mod+Shift+q . "kill")
($mod+d . "exec $menu")
($mod+Shift+c . "reload")
($mod+Shift+e
 . ,#~(string-append
       "exec " #$sway "/bin/swaynag -t warning -m \\\n    "
       "'You pressed the exit shortcut.  Do you really want to exit sway?"
       " This will end your Wayland session.' \\\n    "
       "-B 'Yes, exit sway' \\\n    '"
       #$sway "/bin/swaymsg exit'"))
($mod+$left . "focus left")
($mod+$down . "focus down")
($mod+$up . "focus up")
($mod+$right . "focus right")
($mod+Left . "focus left")
($mod+Down . "focus down")
($mod+Up . "focus up")
($mod+Right . "focus right")
($mod+Shift+$left . "move left")
($mod+Shift+$down . "move down")
($mod+Shift+$up . "move up")
($mod+Shift+$right . "move right")
($mod+Shift+Left . "move left")
($mod+Shift+Down . "move down")
($mod+Shift+Up . "move up")
($mod+Shift+Right . "move right")
($mod+Mod1+Shift+$right . "move workspace to output right")
($mod+Mod1+Shift+$left . "move workspace to output left")
($mod+Mod1+Shift+$down . "move workspace to output down")
($mod+Mod1+Shift+$up . "move workspace to output up")
($mod+1 . "workspace number 1")
($mod+2 . "workspace number 2")
($mod+3 . "workspace number 3")
($mod+4 . "workspace number 4")
($mod+5 . "workspace number 5")
($mod+6 . "workspace number 6")
($mod+7 . "workspace number 7")
($mod+8 . "workspace number 8")
($mod+9 . "workspace number 9")
($mod+0 . "workspace number 10")
($mod+Shift+1 . "move container to workspace number 1")
($mod+Shift+2 . "move container to workspace number 2")
($mod+Shift+3 . "move container to workspace number 3")
($mod+Shift+4 . "move container to workspace number 4")
($mod+Shift+5 . "move container to workspace number 5")
($mod+Shift+6 . "move container to workspace number 6")
($mod+Shift+7 . "move container to workspace number 7")
($mod+Shift+8 . "move container to workspace number 8")
($mod+Shift+9 . "move container to workspace number 9")
($mod+Shift+0 . "move container to workspace number 10")
($mod+q . "splith") ;; user modified 
($mod+w . "splitv") ;; user modified
($mod+s . "layout stacking")
($mod+t . "layout tabbed")
($mod+e . "layout toggle split")
($mod+n . "fullscreen") ;; user modified
($mod+Shift+space . "floating toggle")
($mod+space . "focus mode_toggle")
($mod+p . "focus parent") ;; user modified
($mod+o . "focus child") ;; user modified
($mod+Shift+minus . "move scratchpad")
($mod+Mod1+return . "scratchpad show") ;; user modified
($mod+r . "mode \"resize\"")

Bar

(bar (sway-bar
       (position 'bottom)
       (hidden-state 'hide)
       (binding-mode-indicator #t)
       (status-command "i3blocks")
       (colors (sway-color
		(background "#2C2C2C")
		(statusline "#DCDCDC")
		(focused-workspace unity-orange)
		(active-workspace  unity-neutral)
		(inactive-workspace unity-dark)
		(urgent-workspace  unity-urgent)))))

Colors

(extra-content
 (append
  
  <<window-rules-extra>>
  
  (let ((serialize (lambda (label rec)
                     (format #f "client.~a ~a ~a ~a #2ECC71 ~a"
                             label
                             (sway-border-color-border rec)
                             (sway-border-color-background rec)
                             (sway-border-color-text rec)
                             (sway-border-color-border rec)))))
    (list
     (serialize "focused"          unity-orange)
     (serialize "focused_inactive" unity-neutral)
     (serialize "unfocused"        unity-dark)
     (serialize "urgent"           unity-urgent)
     "client.background #2C2C2C"))))

Startup

(startup-programs 
 (list
  #~(string-append
     #$swayidle "/bin/swayidle -w \\\n    "
     ;; 300: lock screen.
     "timeout 300 '" #$swaylock "/bin/swaylock "
     "--indicator-radius 75 \\\n    "
     "-i "
     "~/.config/sway/wall \\\n    "
     "-f -c 000000' \\\n    "
     ;; 600: lock + screen off.
;;     "timeout 600 '" #$sway "/bin/swaymsg \"output * power off\"' \\\n    "
     ;; 900: Sleep
     ;;    "timeout 900 '" #$sway "/bin/swaymsg \"output * power off\"' \\\n    "
     ;; "timeout 900 '" #$(file-append elogind "/bin/loginctl") " suspend' \\\n    "
     "timeout 900 '/run/current-system/profile/bin/loginctl suspend' \\\n    "
     ;; Resume + sleep.
     "resume '" #$sway "/bin/swaymsg \"output * power on\"' \\\n    "
     "before-sleep '" #$swaylock "/bin/swaylock -f -c 000000'")
  
  "~/.qolscripts/emacs-daemon.sh"
  "mako"
  "transmission-daemon"
  "blueman-applet"
  ))

Extra content, window rules

`("default_border pixel 2"
  "font pango:monospace 8"
  "assign [class=\"qBittorrent\"] 9"
  "assign [class=\"discord\"] 10"
  "assign [class=\"steam\"] 9"
  "for_window [app_id=\"imv\"] floating enable"
  "for_window [class=\"ThinkFan UI\"] floating enable"
  "for_window [class=\"XPaint\"] floating enable, move position 10px 10px"
  "for_window [class=\"TopLevelShell\"] floating enable"
  "for_window [title=\"^emacs-minibuffer$\"] floating enable, resize set 1200 600, border none"
  "for_window [title=\"^emacs-minibuffer$\"] sticky enable"
  "smart_borders on"
  "smart_gaps on"
  "seat seat0 xcursor_theme Bibata-Original-Classic 22"
  "floating_modifier $mod normal"
  )

About

My GNU Guix Config

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages