-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloki.scm
188 lines (177 loc) · 5.01 KB
/
loki.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
;; my work notebook
(use-modules (gnu)
(gnu packages base) ;; for canonical-package
(gnu system)
(gnu system linux-initrd)
(guix gexp)
(guix store)
(srfi srfi-1))
(use-package-modules
admin
autotools
avahi
avahi
base
bash
bootloaders
certs
code
commencement
connman
cryptsetup
curl
docker
display-managers
emacs
enlightenment
gdb
glib
gnome
gnuzilla
guile-xyz
linux
linux-vanilla
mail
mc
ncdu
nfs
patchutils
pulseaudio
shells
ssh
suckless
synergy
texinfo
tls
version-control
video
vpn
web-browsers
wget
wm
xfce
xorg
xorg
)
(use-service-modules
avahi
base
desktop
docker
mcron
networking
ssh
xorg
)
(define personal-mail-sync-job
#~(job "*/5 * * * *" "/home/tcech/bin/stahni_postu.sh"
#:user "tcech"))
;; for special-files-service-type
(define-syntax module-package
(syntax-rules ()
((_ module (package output))
(list (@ module package) output))
((_ module package)
(@ module package))))
(define-syntax-rule (guix-package module-part package)
"Return PACKAGE from (gnu packages MODULE-PART) module."
(module-package (gnu packages module-part) package))
(operating-system
(host-name "loki")
(timezone "Europe/Prague")
(locale "cs_CZ.UTF-8")
;; prepare configuration but don't install bootloader
(bootloader
(bootloader-configuration
(bootloader
(bootloader
(inherit grub-bootloader) (installer #~(const #t))))))
;; root filesystem
(file-systems (append (list (file-system
;; (title 'device)
(device "/dev/nvme0n1p3")
(mount-point "/")
(type "ext4")
(needed-for-boot? #t)))
%base-file-systems))
(swap-devices '("/dev/nvme0n1p2"))
(users (cons (user-account
(name "tcech")
(uid 1000) (group "users")
(supplementary-groups '("lp" "wheel" "netdev"
"audio" "video" "docker"))
(comment "Tomáš Čech")
(password "password")
(shell (file-append zsh "/bin/zsh"))
(home-directory "/home/tcech"))
%base-user-accounts))
(packages
(append
(list
nss-certs
;;;; absolutely necessary ;;;;;
emacs lvm2 bash texinfo
grub nss-mdns procps cryptsetup alsa-utils
;;;; networking ;;;;
iptables links wpa-supplicant dbus
;; connman
vpnc openconnect openssl ;; for config in /etc
network-manager network-manager-openvpn openvpn
zsh ;; better shell as login shell
;;;;; other ;;;;;
nfs-utils btrfs-progs ;; programs required by filesystems
slock ;; required here because of setuid bit
xrandr ;; for monitor udev rule hook
wget curl ;; default web access from scripts or command line
i3-wm ;; if not system-wide, can't be use for login session
htop mc ncdu ;; basic system tools
pulseaudio
bluez
)
%base-packages))
(services
(cons* (gnome-desktop-service)
(xfce-desktop-service)
(bluetooth-service)
(service docker-service-type)
(service mcron-service-type
(mcron-configuration (mcron mcron) (jobs (list personal-mail-sync-job))))
(service openssh-service-type
(openssh-configuration
(x11-forwarding? #t)
(permit-root-login 'without-password)))
;; Using 'canonical-package' as bash and coreutils
;; canonical packages are already a part of
;; '%base-packages'.
(service special-files-service-type
`(("/bin/sh"
,(file-append (canonical-package
(guix-package bash bash))
"/bin/bash"))
("/bin/bash"
,(file-append (canonical-package
(guix-package bash bash))
"/bin/bash"))
("/bin/zsh"
,(file-append (canonical-package
(guix-package shells zsh))
"/bin/zsh"))
("/usr/bin/env"
,(file-append (canonical-package
(guix-package base coreutils))
"/bin/env"))))
(modify-services %desktop-services
(elogind-service-type config =>
(elogind-configuration
(handle-lid-switch 'ignore)
(lid-switch-ignore-inhibited? #f))))))
(sudoers-file
(plain-file "sudoers"
"root ALL=(ALL) ALL
%wheel ALL=(ALL) ALL
tcech ALL = NOPASSWD: /usr/local/bin/local_suspend.sh
tcech ALL = NOPASSWD: /usr/local/bin/brightness.sh
"))
(name-service-switch %mdns-host-lookup-nss)
(kernel linux-loki)
(initrd-modules '()))