lukejw.scm (8078B)


      1 (define-module (home lukejw)
      2   #:use-module (gnu home)
      3   #:use-module (gnu home services)
      4   #:use-module (gnu home services desktop)
      5   #:use-module (gnu home services fontutils)
      6   #:use-module (gnu home services mpv)
      7   #:use-module (gnu home services shells)
      8   #:use-module (gnu home services shepherd)
      9   #:use-module (gnu home services sound)
     10   #:use-module (gnu home services ssh)
     11   #:use-module (gnu home services sway)
     12   #:use-module (gnu home services xdg)
     13   #:use-module (gnu packages admin)
     14   #:use-module (gnu packages base)
     15   #:use-module (gnu packages chromium)
     16   #:use-module (gnu packages disk)
     17   #:use-module (gnu packages emacs)
     18   #:use-module (gnu packages emulators)
     19   #:use-module (gnu packages file)
     20   #:use-module (gnu packages fonts)
     21   #:use-module (gnu packages freedesktop)
     22   #:use-module (gnu packages games)
     23   #:use-module (gnu packages gimp)
     24   #:use-module (gnu packages gl)
     25   #:use-module (gnu packages gnome)
     26   #:use-module (gnu packages gnome-xyz)
     27   #:use-module (gnu packages gnupg)
     28   #:use-module (gnu packages image-viewers)
     29   #:use-module (gnu packages inkscape)
     30   #:use-module (gnu packages kde-frameworks)
     31   #:use-module (gnu packages librewolf)
     32   #:use-module (gnu packages linux)
     33   #:use-module (gnu packages lxqt)
     34   #:use-module (gnu packages mail)
     35   #:use-module (gnu packages pdf)
     36   #:use-module (gnu packages polkit)
     37   #:use-module (gnu packages pulseaudio)
     38   #:use-module (gnu packages qt)
     39   #:use-module (gnu packages rsync)
     40   #:use-module (gnu packages syndication)
     41   #:use-module (gnu packages terminals)
     42   #:use-module (gnu packages text-editors)
     43   #:use-module (gnu packages toys)
     44   #:use-module (gnu packages version-control)
     45   #:use-module (gnu packages video)
     46   #:use-module (gnu packages web-browsers)
     47   #:use-module (gnu packages w3m)
     48   #:use-module (gnu packages wm)
     49   #:use-module (gnu packages xdisorg)
     50   #:use-module (gnu services)
     51   #:use-module (gnu system keyboard)
     52   #:use-module (guix build-system copy)
     53   #:use-module (guix gexp)
     54   #:use-module (guix git-download)
     55   #:use-module (guix packages)
     56   #:use-module (mt packages aseprite)
     57   #:use-module (mt packages games)
     58   #:use-module (mt packages fonts)
     59   #:use-module (nongnu packages messaging)
     60   #:use-module (nongnu packages game-client)
     61   #:use-module (home lukejw sway)
     62   #:export (lukejw-home-environment))
     63 
     64 ;; TODO: Organize
     65 
     66 (define i3blocks-config
     67   (plain-file "config" "\
     68 border=#CECDC3
     69 background=#FFFCF0
     70 
     71 [name]
     72 command=echo ${USER}@${HOSTNAME}
     73 interval=once
     74 
     75 [weather]
     76 command=curl wttr.in/?format=\"%t++%c%C\\n\"
     77 interval=900
     78 
     79 [time]
     80 command=date -R
     81 interval=1
     82 
     83 [battery]
     84 command=echo \"$(cat /sys/class/power_supply/BAT0/capacity)% ($(cat /sys/class/power_supply/BAT0/status)) \"
     85 interval=30
     86 "))
     87 
     88 ;; Files to help theme QT
     89 
     90 (define lxqt-config
     91   (plain-file "lxqt.conf" "\
     92 [General]
     93 icon_theme=oxygen
     94 
     95 [Qt]
     96 style=kvantum"))
     97 
     98 (define lukejw-home-environment
     99   (home-environment
    100     (packages
    101       (list ;; Emacs
    102             emacs-pgtk
    103             ;; Apps
    104             pavucontrol-qt
    105             ungoogled-chromium
    106             librewolf
    107             aseprite
    108             kakoune
    109             newsraft ;; TODO: Make home-newsraft-service-type (?)
    110             signal-desktop
    111             btop
    112             lf file chafa ;; TODO: Make home-lf-service-type
    113             aerc w3m ;; TODO: Make home-aerc-service-type
    114             ;; Fonts
    115             font-fira-mono-nerd-font
    116             font-google-noto-emoji
    117             ;; Utils
    118             git
    119             rsync
    120             ;; Theming
    121             lxqt-qtplugin
    122             kvantum
    123             oxygen-icons
    124             ;; Media
    125             zathura
    126             zathura-pdf-mupdf
    127             mpv
    128             ffmpeg
    129             wf-recorder
    130             yt-dlp
    131             ;; Creative
    132             gimp
    133             inkscape
    134             ;; Games
    135             steam
    136             crispy-doom
    137             freedoom
    138             prismlauncher
    139             ;; Emulation
    140             jgrf
    141             jg-bsnes
    142             jg-nestopia
    143             ;; Toys
    144             cbonsai
    145             cmatrix))
    146     (services
    147       (append
    148         (list
    149           (service home-dbus-service-type)
    150           (service home-bash-service-type
    151                    (home-bash-configuration
    152                      (guix-defaults? #f)
    153                      (aliases `(("gs" . "git status")
    154                                 ;; Shortcut to download a YouTube video into audio format
    155                                 ("yta" . "yt-dlp -t aac --add-metadata -o \"~/Audio/%(channel)s/%(upload_date)s - %(title)s.%(ext)s\"")
    156                                 ;; Shortcut to download a YouTube playlist in audio format and organize it
    157                                 ("ytap" . "yt-dlp -t aac --add-metadata \
    158 -o \"~/Audio/%(channel)s/%(playlist_title)s/%(playlist_id)s_%(playlist_index)s - %(title)s.%(ext)s\"")
    159                                 ;; Shortcut to start a local http server
    160                                 ("qs" . "guix shell python -- python3 -m http.server")
    161                                 ;; TODO: Make fancy sway recording script w/ i3block indicator
    162                                 ("record" . "wf-recorder --audio -c h264_vaapi -d /dev/dri/renderD128")))))
    163           ;; Automatically start pipewire
    164           (service home-pipewire-service-type)
    165           (service home-ssh-agent-service-type)
    166           (simple-service 'basic-environment-variables
    167                           home-environment-variables-service-type
    168                           `(("EDITOR" . "kak")))
    169           ;; TODO: Make a home service for using kvantum with lxqt-qtplugin
    170           (simple-service 'qt-environment-variables
    171                           home-environment-variables-service-type
    172                           `(("QT_QPA_PLATFORMTHEME" . "lxqt")))
    173           (simple-service 'jollygood-environment-variables
    174                           home-environment-variables-service-type
    175                           `(("JOLLYGOOD_ASSET_DIRS" . "$HOME/.guix-home/profile/share/jollygood")
    176                             ("JOLLYGOOD_CORE_DIRS" . "$HOME/.guix-home/profile/lib/jollygood")))
    177           (simple-service 'custom-fonts-service
    178                           home-fontconfig-service-type
    179                           (list "~/.guix-home/profile/share/fonts"
    180                                 '(alias
    181                                   (family "monospace")
    182                                   (prefer
    183                                    (family "Fira Mono Nerd Font"))
    184                                   (prefer
    185                                    (family "Noto Color Emoji")))))
    186           ;; TODO: Setup more advanced MPV config
    187           (service home-mpv-service-type
    188                    (make-home-mpv-configuration
    189                     #:global (make-mpv-profile-configuration
    190                               #:hwdec '("auto")
    191                               #:alang '("en")
    192                               #:slang '("en"))))
    193           ;; Morning alarm
    194           (simple-service
    195            'morning-alarm home-shepherd-service-type
    196            (list (shepherd-timer '(morning-alarm)
    197                   #~(calendar-event #:hours '(3) #:minutes '(10))
    198                   #~(#$(file-append mpv "/bin/mpv")
    199                      "--msg-level=all=warn"
    200                      "--force-window"
    201                      "--title=ALARM"
    202                      "--loop"
    203                      #$(local-file "lukejw/alarm.m4a")))))
    204           ;; Config files
    205           (simple-service 'extra-config-files
    206                           home-xdg-configuration-files-service-type
    207                           `(("i3blocks/config" ,i3blocks-config)
    208                             ;; TODO: Make home-tofi-service-type
    209                             ("tofi" ,(local-file "lukejw/tofi"
    210                                                  #:recursive? #t))
    211                             ("foot/foot.ini" ,(local-file "lukejw/foot.ini"))
    212                             ("lxqt/lxqt.conf" ,lxqt-config)))
    213           ;; Setup a sway configuration
    214           (service home-sway-service-type %sway-configuration))
    215         %base-home-services))))
    216 
    217 lukejw-home-environment