summaryrefslogtreecommitdiff
path: root/.config/guix/common.scm
blob: 64666d770016b9795c05967638966aeac41ef6d3 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
(define-module (common)
  #:use-module (gnu)
  #:use-module (gnu services)
  #:use-module (gnu home)
  #:use-module (gnu home services)
  #:use-module (gnu home services shells)
  #:use-module (gnu home services mcron)
  #:use-module (guix gexp))

(define-public common-home-services
  (list
   ;; Set up the shell environment
   (service home-bash-service-type
            (home-bash-configuration
             (bash-profile
              `(,(plain-file "bash-profile-extras"
                             (string-append
                              ;; Load the Nix profile
                              "if [ -f /run/current-system/profile/etc/profile.d/nix.sh ]; then\n"
                              "  . /run/current-system/profile/etc/profile.d/nix.sh\n"
                              "fi\n"

                              ;; Don't use the system-level PulseAudio configuration
                              "unset PULSE_CONFIG\n"
                              "unset PULSE_CLIENTCONFIG\n"))))

             (environment-variables
              '( ;; Sort hidden (dot) files first in `ls` listings
                ("LC_COLLATE" . "C")

                ;; Emacs is our editor
                ("VISUAL" . "emacsclient")
                ("EDITOR" . "emacsclient")

                ;; Add some things to $PATH (maybe integrate into other services?)
                ("PATH" . "$HOME/.dotfiles/.bin:$HOME/.npm-global/bin:$PATH")

                ;; Make sure Flatpak apps are visible
                ("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share")

                ;; Make sure JAVA_HOME is set
                ;; TODO:  Move this to a different service
                ("JAVA_HOME" . "$(dirname $(dirname $(readlink $(which java))))")

                ;; Fix issues with Qutebrowser
                ;; TODO: Move this to Qutebrowser service
                ("QTWEBENGINE_CHROMIUM_FLAGS" . "--disable-seccomp-filter-sandbox")

                ;; Set the SSH authentication socket
                ;; TODO: Move to a gpg service
                ("SSH_AUTH_SOCK" . "$(gpgconf --list-dirs agent-ssh-socket)")))))

   ;; Set up desktop environment


   ;; Start background jobs
   (service home-mcron-service-type
            (home-mcron-configuration
             (jobs
              (list
               #~(job
                  '(next-hour (range 0 24 4))
                  "~/.dotfiles/.bin/sync-passwords")))))))

   ;; Udiskie for auto-mounting devices