guix-config

Configuration files for Guix

git clone https://git.8pit.net/guix-config.git

  1;; This Guix Home configuration is intentionally very simple and
  2;; essentially limited to the installation of packages and the
  3;; configuration of user services. Configuration files are managed
  4;; without Guix Home.
  5
  6(define-module (guix-home-config)
  7  #:use-module (guix gexp)
  8  #:use-module (gnu home)
  9  #:use-module (gnu home services)
 10  #:use-module (gnu home services desktop)
 11  #:use-module (gnu home services shells)
 12  #:use-module (gnu home services shepherd)
 13  #:use-module (gnu home services sound)
 14  #:use-module (gnu packages)
 15  #:use-module (gnu packages bash)
 16  #:use-module (gnu packages linux)
 17  #:use-module (gnu packages xdisorg)
 18  #:use-module (gnu services)
 19  #:use-module (gnu system shadow)
 20  #:use-module (nmeum packages desktop)
 21  #:use-module (nmeum packages misc))
 22
 23(define packages-desktop
 24  '("adwaita-icon-theme"
 25    "alacritty"
 26    "bemenu"
 27    "creek"
 28    "firefox"
 29    "river"
 30    "waylock"
 31    "wl-clipboard"
 32    "wlr-randr"
 33    "wlsunset"))
 34
 35(define packages-documents
 36  '("mandoc"))
 37
 38(define packages-font
 39  '("fontconfig"
 40    "font-terminus-patched"
 41    "font-terminus-patched:otb"
 42    "font-google-noto"
 43    "font-google-noto-emoji"
 44    "font-dejavu"))
 45
 46(define packages-networking
 47  '("bind:utils"
 48    "iproute2"
 49    "mosh"
 50    "mtr"
 51    "whois"))
 52
 53(define packages-multimedia
 54  '("ncmpc"
 55    "mpv"
 56    "pipewire"
 57    "wireplumber"
 58    "yt-dlp"))
 59
 60(define packages-programming
 61  '("curl"
 62    "clang"
 63    "gcc-toolchain"
 64    "git"
 65    "make"
 66    "neovim"
 67    "python"
 68    "universal-ctags"))
 69
 70(define packages-tools
 71  '("chimerautils"
 72    "cryptsetup"
 73    "file"
 74    "fzf"
 75    "htop"
 76    "ripgrep"
 77    "strace"
 78    "tmux"
 79    "tree"))
 80
 81(define my-packages
 82  (append
 83    packages-desktop
 84    packages-documents
 85    packages-font
 86    packages-networking
 87    packages-multimedia
 88    packages-programming
 89    packages-tools))
 90
 91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 92
 93(define (my-essential-services he)
 94  ;; I don't want Guix home to overwrite my ~/.profile.
 95  ;; Therefore, I remove the services responsible for that.
 96  (filter
 97    (lambda (s)
 98      ;; The home-shell-profile creates the ~/.profile file.
 99      (not (eqv? (service-type-name (service-kind s)) 'home-shell-profile)))
100    (home-environment-essential-services he)))
101
102(define home-config
103  (let ((home-environment-base
104          ;; Need to set packages here, otherwise the essential services
105          ;; operate on an empty package set and no package is installed.
106          (home-environment
107            (packages (specifications->packages my-packages)))))
108    (home-environment
109      ;; Awful hack to change the default essential services.
110      (inherit home-environment-base)
111      (essential-services
112        (my-essential-services home-environment-base))
113
114      (services
115        (append
116          (list
117            ;; Needed to start services which use WAYLAND_DISPLAY.
118            ;; See: https://issues.guix.gnu.org/76619
119            (service home-shepherd-service-type
120                     (home-shepherd-configuration
121                       (auto-start? #f)))
122
123            (simple-service 'wlsunset
124              home-shepherd-service-type
125              (list (shepherd-service
126                      (provision '(wlsunset))
127                      (start
128                        #~(make-forkexec-constructor
129                            (list
130                              (string-append #$wlsunset "/bin/wlsunset")
131                              "-l" "52.3" "-L" "11.1")))
132                      (stop #~(make-kill-destructor)))))
133
134            (simple-service 'dam
135              home-shepherd-service-type
136              (list (shepherd-service
137                      (provision '(dam))
138                      (start
139                        ;; TODO: Supervise status text and status bar service separately.
140                        #~(make-forkexec-constructor
141                            (list (string-append #$bash-minimal "/bin/sh") "-c"
142                                  (format #f
143                                    "(while ~a 5; do ~a; done) | ~a ~a"
144                                    (string-append #$chimera-utils "/bin/sleep")
145                                    (string-append #$chimera-utils "/bin/date")
146                                    (string-append #$dam "/bin/dam")
147                                    (string-join
148                                      '("-f Terminus:size=12"
149                                        "-nb '#282828'"
150                                        "-nf '#b8b8b8'"
151                                        "-sb '#7cafc2'"
152                                        "-sf '#181818'") " ")))))
153                      (stop #~(make-kill-destructor)))))
154
155            (service home-dbus-service-type)
156            (service home-pipewire-service-type
157                     (home-pipewire-configuration
158                       (enable-pulseaudio? #t))))
159          %base-home-services)))))
160
161home-config