-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.scm
118 lines (116 loc) · 4.43 KB
/
home.scm
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
;; This "home-environment" file can be passed to 'guix home reconfigure'
;; to reproduce the content of your profile. This is "symbolic": it only
;; specifies package names. To reproduce the exact same profile, you also
;; need to capture the channels being used, as returned by "guix describe".
;; See the "Replicating Guix" section in the manual.
(use-modules (gnu home)
(gnu home services)
(gnu home services shells)
(gnu home services shepherd)
(gnu home services xdg)
(gnu packages)
(gnu packages emacs)
(gnu packages syncthing)
(gnu services)
(gnu services shepherd)
(gnu services xorg)
(guix transformations)
(guix gexp))
(define (home-log name)
#~(string-append (or (getenv "XDG_LOG_HOME")
(string-append (getenv "HOME") "/.log"))
"/" #$name ".log"))
(home-environment
(packages
(map (compose list specification->package+output)
(list "dwm-w"
"dmenu"
"ranger"
"file"
"fish"
"alacritty"
"fontconfig"
"font-google-noto"
;; tools
"tmux"
"htop"
"fzf"
"ncdu"
"ripgrep"
"exa"
"bat"
"zoxide"
"hyperfine"
;; Xorg
"xorg-server"
"xf86-input-libinput"
"xf86-video-fbdev"
"xinit"
"xsel"
"xset"
"setxkbmap"
"sx"
;; dev
"direnv"
"emacs"
"kakoune"
"kak-lsp"
"git"
"git-lfs"
"subversion"
"diffstat"
"tokei"
;; multimedia
"mpv"
"yt-dlp"
"pipewire"
;; misc
"weechat"
"syncthing"
"squashfs-tools-ng")))
(services
(list
(simple-service 'my-profile
home-shell-profile-service-type
(list (plain-file "profile"
(string-join '("case $(tty) in"
"/dev/tty1) exec startx;;"
"esac") "\n"))))
(simple-service 'my-env-vars
home-environment-variables-service-type
;; TODO dir_colors solarized
'(("PATH" . "$HOME/bin:$PATH")
("EDITOR" . "$HOME/bin/e")
("PAGER" . "$HOME/bin/p")
("VISUAL" . "emacsclient -c")
("BAT_THEME" . "ansi")))
(service home-xdg-user-directories-service-type
(home-xdg-user-directories-configuration
(desktop "$HOME/desktop")
(documents "$HOME/documents")
(download "$HOME/download")
(music "$HOME/music")
(pictures "$HOME/pictures")
(publicshare "$HOME")
(templates "$HOME")
(videos "$HOME/videos")))
(simple-service 'my-home-services
home-shepherd-service-type
(list (shepherd-service
(provision '(syncthing))
(documentation "Run `syncthing' without calling the browser")
(start #~(make-forkexec-constructor
(list #$(file-append syncthing "/bin/syncthing")
"-no-browser"
"-logflags=3") ;; prefix with date & time
#:log-file #$(home-log "syncthing")))
(stop #~(make-kill-destructor)))
(shepherd-service
(provision '(emacs))
(documentation "Run `emacs --daemon'")
(start #~(make-forkexec-constructor
(list #$(file-append emacs "/bin/emacs")
"--fg-daemon")
#:log-file #$(home-log "emacs")))
(stop #~(make-system-destructor "emacsclient -e '(kill-emacs)'"))
(respawn? #f)))))))