From 93b2088a04c13a9f4f5934948fc9540f9f552b00 Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 25 Jan 2025 15:15:56 -0500 Subject: Refactor guix config for a single central packages file --- .config/guix/garm.scm | 25 +-- .config/guix/modules/base.scm | 289 ----------------------------- .config/guix/modules/dwm.scm | 6 - .config/guix/modules/emacs.scm | 55 ------ .config/guix/modules/packages/packages.scm | 173 +++++++++++++++++ .config/guix/modules/services/base.scm | 182 ++++++++++++++++++ .config/guix/modules/services/xorg.scm | 96 ++++++++++ .config/guix/modules/xorg.scm | 136 -------------- .config/guix/modules/ymir.scm | 17 +- 9 files changed, 475 insertions(+), 504 deletions(-) delete mode 100644 .config/guix/modules/base.scm delete mode 100644 .config/guix/modules/emacs.scm create mode 100644 .config/guix/modules/packages/packages.scm create mode 100644 .config/guix/modules/services/base.scm create mode 100644 .config/guix/modules/services/xorg.scm delete mode 100644 .config/guix/modules/xorg.scm (limited to '.config') diff --git a/.config/guix/garm.scm b/.config/guix/garm.scm index 4dc783b..e4d895c 100644 --- a/.config/guix/garm.scm +++ b/.config/guix/garm.scm @@ -10,10 +10,11 @@ #:use-module (gnu services guix) #:use-module (gnu services pm) #:use-module (guix gexp) - #:use-module (modules base) - #:use-module (modules mail) - #:use-module (modules xorg) - #:use-module (modules ymir)) + #:use-module (packages packages) + #:use-module (services base) + #:use-module (services mail) + #:use-module (services xorg) + #:use-module (ymir)) ;;; Commentary: ;;; @@ -23,9 +24,13 @@ (define home (home-environment + (packages + `(,@bd-packages-desktop + ,@bd-packages-fun + ,@bd-packages-extra + ,@bd-packages-development)) (services - `( - ,@bd-base-home-services + `(,@bd-base-home-services ,@bd-mail-home-services ,@bd-desktop-home-services)))) @@ -35,12 +40,8 @@ (host-name "garm") (packages - `(,@bd-base-system-packages - ,@bd-desktop-system-packages - ,@(list - brightnessctl - macchanger - tlp))) + `(,@bd-packages-system + ,@bd-packages-laptop)) (services `(,@bd-base-system-services diff --git a/.config/guix/modules/base.scm b/.config/guix/modules/base.scm deleted file mode 100644 index 389ff56..0000000 --- a/.config/guix/modules/base.scm +++ /dev/null @@ -1,289 +0,0 @@ -(define-module (modules base) - #:use-module (gnu) - #:use-module (gnu home services) - #:use-module (gnu home services dict) - #:use-module (gnu home services gnupg) - #:use-module (gnu home services mcron) - #:use-module (gnu home services shells) - #:use-module (gnu home services shepherd) - #:use-module (gnu home services ssh) - #:use-module (gnu home services xdg) - #:use-module (ice-9 rdelim) - #:use-module (gnu system) - #:use-module (guix gexp) - #:use-module (modules emacs) - #:export (bd-base-system-packages - bd-base-system-services - bd-base-home-services)) - -(use-service-modules admin avahi base - dbus desktop file-sharing - networking ssh) - -(use-package-modules - admin ;; netcat - algebra ;; bc - commencement ;; gcc-toolchain - compression ;; unzip, zip - cryptsetup ;; cryptsetup - curl ;; curl - databases ;; recutils - education ;; anki - emulators ;; mupen64plus*, bsnes, mgba - fonts ;; font-terminus, font-openmoji, font-awesome - fontutils ;; fontconfig - games ;; nethack - gimp ;; gimp-next - gnupg ;; gnupg, pinentry, pinentry-emacs - gnuzilla ;; icecat - graphviz ;; graphviz - image ;; flameshot - imagemagick ;; imagemagick - image-viewers ;; nsxiv - librewolf ;; librewolf - linux ;; sysstat - mail ;; offlineimap - man ;; man-pages - package-management ;; stow - password-utils ;; pass-otp, password-store - pdf ;; xpdf, pdfgrep, zathura, zathura-pdf-mupdf - python ;; python - rsync ;; rsync - screen ;; screen - rust-apps ;; ripgrep - texlive ;; texlive - tex ;; texlive-dvipng - tor-browsers ;; tor-browser - version-control ;; git - video ;; ffmpeg, mpv, yt-dlp - vim ;; vim - web ;; jq - ) - -(define (read-hosts filename) - (let ((port (open-input-file filename))) - (let loop ((lines '())) - (let ((line (read-line port))) - (if (eof-object? line) - (begin (close-input-port port) - lines) - (loop (cons line lines))))))) - -(define base - (list - gnupg - offlineimap3 - pass-otp - password-store - pinentry-emacs - screen - xpdf ; pdftotext - yt-dlp - - anki - bc - cryptsetup - curl - gcc-toolchain - git - jq - man-pages - netcat - nsxiv - pdfgrep - python - recutils - ripgrep - rsync - stow - sysstat - texlive - texlive-dvipng - unzip - vim - zathura - zathura-pdf-mupdf ; epub - zip - )) - -(define desk - (list - bsnes - ffmpeg - flameshot - font-awesome - fontconfig - font-openmoji - font-terminus - gimp - graphviz - icecat - imagemagick - librewolf - mgba - mpv - mupen64plus-audio-sdl - mupen64plus-rsp-hle - mupen64plus-ui-console - nethack - torbrowser - )) - -(define bd-base-system-packages - (append! - base - desk - %base-packages - )) - -(define bd-base-system-services - `( - ;; so that non-root users in the wheel group can - ;; perform administrative tasks (similar to "sudo"). - ,polkit-wheel-service - ;; The global fontconfig cache directory can sometimes contain - ;; stale entries, possibly referencing fonts that have been GC'd, - ;; so mount it read-only. - ,fontconfig-file-system-service - - ,(service network-manager-service-type) - ,(service wpa-supplicant-service-type) ; needed by NetworkManager - ,(service modem-manager-service-type) - ,(service usb-modeswitch-service-type) - - ;; The D-Bus clique. - ,(service avahi-service-type) - ,(service udisks-service-type) - ,(service upower-service-type) - ,(service accountsservice-service-type) - ,(service cups-pk-helper-service-type) - ,(service colord-service-type) - ,(service geoclue-service-type) - ,(service polkit-service-type) - ,(service elogind-service-type - (elogind-configuration - (handle-power-key 'hibernate) - )) - ,(service dbus-root-service-type) - - ,(service ntp-service-type) - - ,(service openssh-service-type - (openssh-configuration - (x11-forwarding? #t) - (permit-root-login 'prohibit-password) - (password-authentication? #f))) - ,(service tor-service-type) - ,(simple-service 'add-extra-hosts - hosts-service-type - (map - (lambda (x) - (host "0.0.0.0" x)) - (read-hosts "/home/bdunahu/.config/guix/assets/blocklist.txt"))) - ,@%base-services)) - -(define bd-base-home-services - (list - (service bd-home-emacs-service-type) - (service home-shepherd-service-type) - - (service home-dicod-service-type) - - (service home-gpg-agent-service-type - (home-gpg-agent-configuration - (pinentry-program - (file-append pinentry-emacs "/bin/pinentry-emacs")) - (ssh-support? #t) - (default-cache-ttl 28800) - (max-cache-ttl 28800) - (default-cache-ttl-ssh 28800) - (max-cache-ttl-ssh 28800))) - - (service home-bash-service-type - (home-bash-configuration - (aliases '(("auth" . "echo -e \"$PWD\n\" >> $HOME/.config/guix/shell-authorized-directories") - ("cp" . "cp -i") - ("grep" . "grep --color=auto") - ("guix-rcfg" . "sudo guix system -L ${HOME}/.config/guix/ reconfigure ${HOME}/.config/guix/${HOSTNAME}.scm") - ("ll" . "ls -l") - ("ls" . "ls -p --color=auto") - ("mkd" . "mkdir -pv") - ("mv" . "mv -i") - ("rm" . "rm -i") - ("suspend" . "sudo loginctl suspend") - ("rig-shell" . "sudo screen /dev/ttyUSB0 115200") - ("vi" . "vim") - ("xeb" . "emacsclient -nce '(switch-to-buffer nil)'") - ("xet" . "emacsclient -nce '(shell)'") - ("ytta" . "yt-dlp --extract-audio --format bestaudio/best") - ("yttv" . "yt-dlp -f b"))) - - - (bashrc (list (plain-file "bashrc" " -# converts above aliases into eshell aliases automatically -alias | sed -E \"s/^alias ([^=]+)='(.*)'$/alias \\1 \\2 \\$*/g; s/'\\\\\\''/'/g;\" >~/.config/emacs/eshell/alias -"))) - (environment-variables - '( - ("BROWSER" . "icecat") - - ("VISUAL" . "emacsclient") - ("EDITOR" . "emacsclient") - - ("NETHACKOPTIONS" . "@$XDG_CONFIG_HOME/nethack/config") - - ("PATH" . "$HOME/.local/bin:$PATH") - ("ZATHURA_PLUGINS_PATH" . "/run/current-system/profile/lib/zathura") - )))) - - (service home-mcron-service-type - (home-mcron-configuration - (jobs - (list - #~(job - ;; twenty minutes - (lambda (current-time) (+ current-time (* 20 60))) - "offlineimap") - #~(job - (lambda (current-time) (+ current-time (* 5 60))) - "~/.local/bin/set-t1"))))) - - (service home-openssh-service-type - (home-openssh-configuration - (hosts - (list (openssh-host (name "garm") - (host-name "localhost") - (user "root")) - (openssh-host (name "vali") - (host-name "192.168.1.136") - (user "bdunahu")) - (openssh-host (name "ivaldi") - (host-name "192.168.1.250") - (user "root")) - (openssh-host (name "heimdallr") - (host-name "operationnull.com") - (user "root")))))) - - (service home-xdg-user-directories-service-type - (home-xdg-user-directories-configuration - (desktop "$HOME/dl") - (documents "$HOME/dc") - (download "$HOME/dl") - (music "$HOME/ik/music") - (pictures "$HOME/md/ig") - (publicshare "$HOME") - (templates "$HOME") - (videos "$HOME/md/vi"))) - - (service home-xdg-mime-applications-service-type - (home-xdg-mime-applications-configuration - (default - '((application/x-bittorrent . torrent.desktop) - (x-scheme-handler/magnet . torrent.desktop))) - (desktop-entries - (list - (xdg-desktop-entry - (file "torrent") - (name "Torrent") - (type 'application) - (config '((exec . "transmission-remote -a %u")))))))))) diff --git a/.config/guix/modules/dwm.scm b/.config/guix/modules/dwm.scm index 1befa60..3c577f5 100644 --- a/.config/guix/modules/dwm.scm +++ b/.config/guix/modules/dwm.scm @@ -6,12 +6,6 @@ #:use-module (guix packages) #:export (bd-dwm-system-packages)) -(use-package-modules - suckless ;; dwm - xdisorg ;; xdotool - xorg ;; xprop - ) - (define bd-dwm (package (inherit dwm) diff --git a/.config/guix/modules/emacs.scm b/.config/guix/modules/emacs.scm deleted file mode 100644 index a3c4972..0000000 --- a/.config/guix/modules/emacs.scm +++ /dev/null @@ -1,55 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Provides a home-service, installing ;; -;; my required emacs packages. Because ;; -;; root cannot use my emacs config, ;; -;; installing packages in my home is ;; -;; ideal. ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - -(define-module (modules emacs) - #:use-module (gnu) - #:use-module (gnu home services) - #:use-module (gnu services) - #:use-module (gnu services configuration) - #:use-module (gnu system) - #:use-module (guix gexp) - #:export (bd-home-emacs-service-type)) - -(use-package-modules - aspell - emacs-xyz - cpp - mail - lisp) - - -(define (bd-emacs-package-list config) - (list - emacs-anki-editor - emacs-dash - emacs-denote - emacs-elpher - emacs-exwm - emacs-f - emacs-guix - emacs-paredit - emacs-pinentry - emacs-rainbow-delimiters - emacs-rainbow-mode - - - aspell - aspell-dict-en - )) - - -(define bd-home-emacs-service-type - (service-type (name 'emacs-config) - (description "A service which deploys my -emacs configuration.") - (extensions - (list (service-extension - home-profile-service-type - bd-emacs-package-list))) - (default-value #f))) diff --git a/.config/guix/modules/packages/packages.scm b/.config/guix/modules/packages/packages.scm new file mode 100644 index 0000000..8a6e614 --- /dev/null +++ b/.config/guix/modules/packages/packages.scm @@ -0,0 +1,173 @@ +(define-module (packages packages) + #:use-module (gnu) + #:use-module (gnu system) + #:use-module (guix gexp) + #:use-module (guix packages) + #:export (bd-packages-system + bd-packages-laptop + bd-packages-desktop + bd-packages-dwm + bd-packages-fun + bd-packages-extra + bd-packages-development + )) + +;;; Commentary: +;;; Code: + +(use-package-modules + admin ;; netcat + algebra ;; bc + commencement ;; gcc-toolchain + compression ;; unzip, zip + compton ;; picom + cryptsetup ;; cryptsetup + curl ;; curl + databases ;; recutils + education ;; anki + emulators ;; mupen64plus*, bsnes, mgba + fonts ;; font-terminus, font-openmoji, font-awesome + fontutils ;; fontconfig + games ;; nethack + gimp ;; gimp-next + gnome ;; libnotify, brightnessctl + networking ;; maccchanger + gnupg ;; gnupg + gnuzilla ;; icecat + graphviz ;; graphviz + image ;; flameshot + imagemagick ;; imagemagick + image-viewers ;; feh, nsxiv + librewolf ;; librewolf + linux ;; sysstat, tlp + mail ;; offlineimap + man ;; man-pages + package-management ;; stow + password-utils ;; pass-otp, password-store + pdf ;; xpdf, pdfgrep, zathura, zathura-pdf-mupdf + pulseaudio ;; pavucontrol, pulseaudio, + python ;; python + rsync ;; rsync + rust-apps ;; ripgrep + screen ;; screen + suckless ;; dwm + texlive ;; texlive + tex ;; texlive-dvipng + tor-browsers ;; tor-browser + version-control ;; git + video ;; ffmpeg, mpv, yt-dlp + vim ;; vim + web ;; jq + wm ;; dunst + xdisorg ;; xdotool, xrdb + xorg ;; xf86-input-libinput, xf86-video-fbdev, xinit... + ) + +(define bd-dwm + (package + (inherit dwm) + (name "bdunahu-dwm") + (inputs (modify-inputs (package-inputs dwm))) + (source (local-file "dwm" #:recursive? #t)))) + +(define bd-packages-system + (append! + (list + cryptsetup + curl + git + man-pages + recutils + ripgrep + screen + sysstat + unzip + vim + zip) + %base-packages)) + +(define bd-packages-laptop + (list + brightnessctl + macchanger + tlp)) + +(define bd-packages-desktop + (list + dunst + feh + ffmpeg + flameshot + font-awesome + fontconfig + font-openmoji + font-terminus + gnupg + graphviz + icecat + imagemagick + libnotify + mpv + nsxiv + password-store + pavucontrol + picom + pulseaudio + texlive + texlive-dvipng + torbrowser + xf86-input-libinput + xf86-video-fbdev + xinit + xinput + xmodmap + xorg-server + xrandr + xrdb + xset + xss-lock + yt-dlp + zathura + zathura-pdf-mupdf + )) + +(define bd-packages-dwm + (list + bd-dwm + xdotool + xprop + )) + +(define bd-packages-fun + (list + bsnes + mgba + mupen64plus-audio-sdl + mupen64plus-rsp-hle + mupen64plus-ui-console + nethack + )) + +(define bd-packages-extra + (list + anki + gimp + librewolf + pdfgrep + xpdf; pdftotext + )) + +(define bd-packages-development + (list + bc + gcc-toolchain + jq + netcat + offlineimap3 + python + rsync + stow + )) + + +;;; packages.scm ends here diff --git a/.config/guix/modules/services/base.scm b/.config/guix/modules/services/base.scm new file mode 100644 index 0000000..7629bf8 --- /dev/null +++ b/.config/guix/modules/services/base.scm @@ -0,0 +1,182 @@ +(define-module (services base) + #:use-module (gnu) + #:use-module (gnu home services) + #:use-module (gnu home services dict) + #:use-module (gnu home services gnupg) + #:use-module (gnu home services mcron) + #:use-module (gnu home services shells) + #:use-module (gnu home services shepherd) + #:use-module (gnu home services ssh) + #:use-module (gnu home services xdg) + #:use-module (gnu packages gnupg) + #:use-module (ice-9 rdelim) + #:use-module (gnu system) + #:use-module (guix gexp) + #:use-module (services emacs) + #:export (bd-base-system-services + bd-base-home-services)) + +(use-service-modules admin avahi base + dbus desktop file-sharing + networking ssh) + +(define (read-hosts filename) + (let ((port (open-input-file filename))) + (let loop ((lines '())) + (let ((line (read-line port))) + (if (eof-object? line) + (begin (close-input-port port) + lines) + (loop (cons line lines))))))) + +(define bd-base-system-services + `( + ;; so that non-root users in the wheel group can + ;; perform administrative tasks (similar to "sudo"). + ,polkit-wheel-service + ;; The global fontconfig cache directory can sometimes contain + ;; stale entries, possibly referencing fonts that have been GC'd, + ;; so mount it read-only. + ,fontconfig-file-system-service + + ,(service network-manager-service-type) + ,(service wpa-supplicant-service-type) ; needed by NetworkManager + ,(service modem-manager-service-type) + ,(service usb-modeswitch-service-type) + + ;; The D-Bus clique. + ,(service avahi-service-type) + ,(service udisks-service-type) + ,(service upower-service-type) + ,(service accountsservice-service-type) + ,(service cups-pk-helper-service-type) + ,(service colord-service-type) + ,(service geoclue-service-type) + ,(service polkit-service-type) + ,(service elogind-service-type + (elogind-configuration + (handle-power-key 'hibernate) + )) + ,(service dbus-root-service-type) + + ,(service ntp-service-type) + + ,(service openssh-service-type + (openssh-configuration + (x11-forwarding? #t) + (permit-root-login 'prohibit-password) + (password-authentication? #f))) + ,(service tor-service-type) + ,(simple-service 'add-extra-hosts + hosts-service-type + (map + (lambda (x) + (host "0.0.0.0" x)) + (read-hosts "/home/bdunahu/.config/guix/assets/blocklist.txt"))) + ,@%base-services)) + +(define bd-base-home-services + (list + (service bd-home-emacs-service-type) + (service home-shepherd-service-type) + + (service home-dicod-service-type) + + (service home-gpg-agent-service-type + (home-gpg-agent-configuration + (pinentry-program + (file-append pinentry-emacs "/bin/pinentry-emacs")) + (ssh-support? #t) + (default-cache-ttl 28800) + (max-cache-ttl 28800) + (default-cache-ttl-ssh 28800) + (max-cache-ttl-ssh 28800))) + + (service home-bash-service-type + (home-bash-configuration + (aliases '(("auth" . "echo -e \"$PWD\n\" >> $HOME/.config/guix/shell-authorized-directories") + ("cp" . "cp -i") + ("grep" . "grep --color=auto") + ("guix-rcfg" . "sudo guix system -L ${HOME}/.config/guix/modules/ reconfigure ${HOME}/.config/guix/${HOSTNAME}.scm") + ("ll" . "ls -l") + ("ls" . "ls -p --color=auto") + ("mkd" . "mkdir -pv") + ("mv" . "mv -i") + ("rm" . "rm -i") + ("suspend" . "sudo loginctl suspend") + ("rig-shell" . "sudo screen /dev/ttyUSB0 115200") + ("vi" . "vim") + ("xeb" . "emacsclient -nce '(switch-to-buffer nil)'") + ("xet" . "emacsclient -nce '(shell)'") + ("ytta" . "yt-dlp --extract-audio --format bestaudio/best") + ("yttv" . "yt-dlp -f b"))) + + + (bashrc (list (plain-file "bashrc" " +# converts above aliases into eshell aliases automatically +alias | sed -E \"s/^alias ([^=]+)='(.*)'$/alias \\1 \\2 \\$*/g; s/'\\\\\\''/'/g;\" >~/.config/emacs/eshell/alias +"))) + (environment-variables + '( + ("BROWSER" . "icecat") + + ("VISUAL" . "emacsclient") + ("EDITOR" . "emacsclient") + + ("NETHACKOPTIONS" . "@$XDG_CONFIG_HOME/nethack/config") + + ("PATH" . "$HOME/.local/bin:$PATH") + ("ZATHURA_PLUGINS_PATH" . "/home/bdunahu/.guix-home/profile/lib/zathura") + )))) + + (service home-mcron-service-type + (home-mcron-configuration + (jobs + (list + #~(job + ;; twenty minutes + (lambda (current-time) (+ current-time (* 20 60))) + "offlineimap") + #~(job + (lambda (current-time) (+ current-time (* 5 60))) + "~/.local/bin/set-t1"))))) + + (service home-openssh-service-type + (home-openssh-configuration + (hosts + (list (openssh-host (name "garm") + (host-name "localhost") + (user "root")) + (openssh-host (name "vali") + (host-name "192.168.1.136") + (user "bdunahu")) + (openssh-host (name "ivaldi") + (host-name "192.168.1.250") + (user "root")) + (openssh-host (name "heimdallr") + (host-name "operationnull.com") + (user "root")))))) + + (service home-xdg-user-directories-service-type + (home-xdg-user-directories-configuration + (desktop "$HOME/dl") + (documents "$HOME/dc") + (download "$HOME/dl") + (music "$HOME/ik/music") + (pictures "$HOME/md/ig") + (publicshare "$HOME") + (templates "$HOME") + (videos "$HOME/md/vi"))) + + (service home-xdg-mime-applications-service-type + (home-xdg-mime-applications-configuration + (default + '((application/x-bittorrent . torrent.desktop) + (x-scheme-handler/magnet . torrent.desktop))) + (desktop-entries + (list + (xdg-desktop-entry + (file "torrent") + (name "Torrent") + (type 'application) + (config '((exec . "transmission-remote -a %u")))))))))) diff --git a/.config/guix/modules/services/xorg.scm b/.config/guix/modules/services/xorg.scm new file mode 100644 index 0000000..2795c1c --- /dev/null +++ b/.config/guix/modules/services/xorg.scm @@ -0,0 +1,96 @@ +(define-module (services xorg) + #:use-module (gnu) + #:use-module (gnu home services) + #:use-module (gnu home services desktop) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (gnu packages suckless) + #:use-module (ymir) + #:export (bd-desktop-system-services + bd-desktop-home-services + )) + +(use-service-modules audio desktop networking + sound xorg) + +(define %keyboard-udev-rule + (udev-rule + "90-keyboard-hotplug.rules" + (string-append "ATTR{idVendor}==\"04b4\", ATTR{idProduct}==\"0510\", ACTION==\"add\", RUN+=\"/run/current-system/profile/bin/touch /tmp/keyboard_plugged\" RUN+=\"/run/current-system/profile/bin/chown " username " /tmp/keyboard_plugged\""))) + +(define bd-desktop-system-services + (list + (service screen-locker-service-type + (screen-locker-configuration + (name "slock") + (program (file-append slock "/bin/slock")))) + + (service x11-socket-directory-service-type) + (udev-rules-service 'keyboard-hotplug %keyboard-udev-rule) + + (service pulseaudio-service-type) + (service alsa-service-type))) + +(define bd-desktop-home-services + (list + (simple-service 'dotfiles + home-files-service-type + `((".Xmodmap" + ,(plain-file "Xmodmap" " +clear lock +clear control +clear mod1 +clear mod2 +clear mod3 +clear mod4 +clear mod5 +keycode 37 = Hyper_L +keycode 66 = Control_L +add control = Control_L Control_R +add mod1 = Alt_L Alt_R Meta_L +add mod2 = Num_Lock +add mod3 = Hyper_L +add mod4 = Super_L Super_R +add mod5 = Mode_switch ISO_Level3_Shift +")) + (".Xresources" + ,(plain-file "Xresources" " +Nsxiv.window.background: #000000 +Nsxiv.window.foreground: #FFFFFF +Nsxiv.bar.font: Terminus:size=9 +")) + (".xinitrc" + ,(plain-file "xinitrc" " +#!/bin/sh + +userresources=$HOME/.Xresources +usermodmap=$HOME/.Xmodmap + +# merge in defaults and keymaps + +if [ -f \"$userresources\" ]; then + + xrdb -merge \"$userresources\" + +fi + +if [ -f \"$usermodmap\" ]; then + xmodmap \"$usermodmap\" +fi + +picom & +xss-lock -- slock & +xset r rate 250 70 +xset s 600 +touchpad-defaults +xrandr-toggle +xkeyboard-auto & +exec emacs -mm")) + (".config/gtk-2.0/settings.ini" + ,(plain-file "settings.ini" " +[Settings] +gtk-application-prefer-dark-theme=1\n")) + (".config/gtk-3.0/settings.ini" + ,(plain-file "settings.ini" " +[Settings] +gtk-application-prefer-dark-theme=1\n")))))) diff --git a/.config/guix/modules/xorg.scm b/.config/guix/modules/xorg.scm deleted file mode 100644 index b857ab9..0000000 --- a/.config/guix/modules/xorg.scm +++ /dev/null @@ -1,136 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Provides a set of my preferred ;; -;; program and services for x desktops ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - -(define-module (modules xorg) - #:use-module (gnu) - #:use-module (gnu home services) - #:use-module (gnu home services desktop) - #:use-module (guix gexp) - #:use-module (guix packages) - #:use-module (modules ymir) - #:export (bd-desktop-system-packages - bd-desktop-system-services - bd-desktop-home-services - )) - -(use-service-modules audio desktop networking - sound xorg) - -(use-package-modules - compton ;; picom - emacs ;; emacs - gnome ;; libnotify - image-viewers ;; feh - pulseaudio ;; pavucontrol, pulseaudio, - suckless ;; slock - wm ;; dunst - xdisorg ;; xrdb - xorg ;; xf86-input-libinput, xf86-video-fbdev, xinit... - ) - -(define bd-desktop-system-packages - (list - dunst - emacs-next - libnotify - pavucontrol - picom - pulseaudio - - feh - xf86-input-libinput - xf86-video-fbdev - xinit - xinput - xmodmap - xorg-server - xrandr - xrdb - xset - xss-lock - )) - -(define %keyboard-udev-rule - (udev-rule - "90-keyboard-hotplug.rules" - (string-append "ATTR{idVendor}==\"04b4\", ATTR{idProduct}==\"0510\", ACTION==\"add\", RUN+=\"/run/current-system/profile/bin/touch /tmp/keyboard_plugged\" RUN+=\"/run/current-system/profile/bin/chown " username " /tmp/keyboard_plugged\""))) - -(define bd-desktop-system-services - (list - (service screen-locker-service-type - (screen-locker-configuration - (name "slock") - (program (file-append slock "/bin/slock")))) - - (service x11-socket-directory-service-type) - (udev-rules-service 'keyboard-hotplug %keyboard-udev-rule) - - (service pulseaudio-service-type) - (service alsa-service-type))) - -(define bd-desktop-home-services - (list - (simple-service 'dotfiles - home-files-service-type - `((".Xmodmap" - ,(plain-file "Xmodmap" " -clear lock -clear control -clear mod1 -clear mod2 -clear mod3 -clear mod4 -clear mod5 -keycode 37 = Hyper_L -keycode 66 = Control_L -add control = Control_L Control_R -add mod1 = Alt_L Alt_R Meta_L -add mod2 = Num_Lock -add mod3 = Hyper_L -add mod4 = Super_L Super_R -add mod5 = Mode_switch ISO_Level3_Shift -")) - (".Xresources" - ,(plain-file "Xresources" " -Nsxiv.window.background: #000000 -Nsxiv.window.foreground: #FFFFFF -Nsxiv.bar.font: Terminus:size=9 -")) - (".xinitrc" - ,(plain-file "xinitrc" " -#!/bin/sh - -userresources=$HOME/.Xresources -usermodmap=$HOME/.Xmodmap - -# merge in defaults and keymaps - -if [ -f \"$userresources\" ]; then - - xrdb -merge \"$userresources\" - -fi - -if [ -f \"$usermodmap\" ]; then - xmodmap \"$usermodmap\" -fi - -picom & -xss-lock -- slock & -xset r rate 250 70 -xset s 600 -touchpad-defaults -xrandr-toggle -xkeyboard-auto & -exec emacs -mm")) - (".config/gtk-2.0/settings.ini" - ,(plain-file "settings.ini" " -[Settings] -gtk-application-prefer-dark-theme=1\n")) - (".config/gtk-3.0/settings.ini" - ,(plain-file "settings.ini" " -[Settings] -gtk-application-prefer-dark-theme=1\n")))))) diff --git a/.config/guix/modules/ymir.scm b/.config/guix/modules/ymir.scm index 5793b9d..70c5743 100644 --- a/.config/guix/modules/ymir.scm +++ b/.config/guix/modules/ymir.scm @@ -1,9 +1,4 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; This configuration defines the base-level ;; -;; services for both of my machines. ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(define-module (modules ymir) +(define-module (ymir) #:use-module (gnu) #:use-module (gnu services desktop) #:use-module (gnu system) @@ -11,6 +6,13 @@ user ymir)) + +;;; Commentary: +;;; +;;; ymir defines a default system configuration +;;; +;;; Code: + (define username "bdunahu") (define user (user-account (name username) @@ -58,3 +60,6 @@ (type "tmpfs") (check? #f)) %base-file-systems)))) + + +;;; ymir.scm ends here -- cgit v1.2.3