source: dotfiles/guix/config.scm@ 14df2de

Last change on this file since 14df2de was 14df2de, checked in by Mikhail Kirillov <w96k@…>, on Oct 3, 2022 at 9:12:24 PM

Change guix config

  • Property mode set to 100644
File size: 9.6 KB
Line 
1;; -*- geiser-scheme-implementation: guile -*-
2
3(use-modules (gnu)
4 (gnu packages)
5 (srfi srfi-1))
6
7(use-service-modules
8 desktop
9 databases
10 networking
11 ssh
12 xorg
13 docker
14 virtualization
15 dbus
16 linux
17 pm
18 vpn
19 nix)
20
21(use-package-modules
22 wm
23 lisp
24 bash
25 linux
26 python
27 gnome
28 gawk
29 xorg
30 xdisorg)
31
32;; (define-public linux-libre-custom
33;; (package
34;; (inherit linux-libre)
35;; (native-inputs
36;; `(("kconfig" ,(local-file "fb.config"))
37;; ,@(alist-delete "kconfig"
38;; (package-native-inputs linux-libre))))))
39
40(define %cpupower-service
41 (simple-service
42 'cpupower activation-service-type
43 #~(zero? (system* #$(file-append cpupower "/bin/cpupower")
44 "frequency-set" "--governor" "schedutil"))))
45
46(define %x86-energy-perf-policy-service
47 (simple-service
48 'x86-energy-perf-policy-service activation-service-type
49 #~(zero? (system* #$(file-append x86-energy-perf-policy "/bin/x86_energy_perf_policy")
50 "--turbo-enable" "0"
51 "--hwp-desired" "16"))))
52
53(define %thinkfan-service
54 (simple-service
55 'thinkfan activation-service-type
56 #~(zero? (system* #$(file-append thinkfan "/sbin/thinkfan")))))
57
58
59(define i915-config
60 (plain-file "i915.conf"
61 "options i915 enable_fbc=1 enable_dc=0 modeset=1 enable_psr=0"))
62
63(define drm-kms-config
64 (plain-file "drm_kms.conf"
65 "options drm_kms_helper poll=N"))
66
67(define thinkpad-acpi-config
68 (plain-file "thinkpad_acpi.conf"
69 "options thinkpad_acpi fan_control=1"))
70
71;; tp_thermal /proc/acpi/ibm/thermal
72
73(define thinkfan-config
74 (plain-file "thinkfan.conf"
75 "\
76hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp3_input
77hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp5_input
78hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp1_input
79hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp4_input
80hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp6_input
81hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp7_input
82hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp8_input
83hwmon /sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/hwmon/hwmon1/temp1_input
84hwmon /sys/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/hwmon/hwmon2/temp1_input
85# hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp3_input
86# hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp2_input
87hwmon /sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp1_input
88hwmon /sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp2_input
89tp_fan /proc/acpi/ibm/fan
90
91(0, 0, 35)
92(1, 30, 40)
93(2, 35, 50)
94(3, 45, 60)
95(4, 55, 65)
96(5, 60, 70)
97(6, 65, 75)
98(7, 70, 85)
99(\"level full-speed\", 78, 120)"))
100
101(define fancontrol-config
102 (plain-file "fancontrol"
103 "
104INTERVAL=10
105DEVPATH=hwmon0=devices/virtual/thermal/thermal_zone0 hwmon1=devices/platform/thinkpad_hwmon
106DEVNAME=hwmon0=acpitz hwmon5=thinkpad
107FCTEMPS=hwmon1/pwm1=hwmon0/temp1_input
108FCFANS= hwmon1/pwm1=hwmon5/fan1_input
109MINTEMP=hwmon1/pwm1=20
110MAXTEMP=hwmon1/pwm1=50
111MINSTART=hwmon1/pwm1=150
112MINSTOP=hwmon1/pwm1=50
113MINPWM=hwmon1/pwm1=10"))
114
115(operating-system
116 (locale "ru_RU.utf8")
117 (timezone "Europe/Tbilisi")
118 (keyboard-layout
119 (keyboard-layout
120 "us,ru"
121 #:options
122 '("grp:shifts_toggle"
123 "caps:ctrl_modifier")))
124 (kernel linux-libre-5.19)
125 ;; (kernel-loadable-modules '())
126 (kernel-arguments
127 '("consoleblank=0"
128 ;; "processor.max_cstate=3" ; Disable power savings
129 ;; "intel_idle.max_cstate=0" ; (cstate 3-4 provides
130 ;; ; high freq cpu noice)
131 "vblank_mode=0"
132 ;;"vm.swappiness=5"
133 "thinkpad_acpi.fan_control=1"
134 "acpi_sleep=s3_bios"
135 "acpi_osi=Linux"
136 "i915.modeset=1"
137 ;; "i915.enable_dc=0"
138 ;; "i915.enable_psr=0"
139 "rootfstype=ext4"
140 "KVM"
141 "loglevel=7"
142 ;;"logo"
143 "ahci.mobile_lpm_policy=1"
144 "intremap=off" ; Fix for failed to map dmar2
145 "modprobe.blacklist=pcspkr,usbmouse,usbkbd,glx"))
146 (host-name "w96k-x200t")
147 (users
148 (cons*
149 (user-account
150 (name "w96k")
151 (comment "Mikhail Kirillov")
152 (group "users")
153 (home-directory "/home/w96k")
154 (supplementary-groups
155 '("wheel" "netdev" "audio" "video" "kvm" "docker")))
156 %base-user-accounts))
157 (packages
158 (append
159 (map
160 specification->package
161 '("xterm"
162 "xinit"
163 "xorg-server"
164 "font-gnu-unifont"
165 "font-gnu-freefont"
166 "mesa"
167 "mesa-utils"
168 "ratpoison"
169 "wmname"
170 "fvwm"
171 "cagebreak" ;; ratpoison for wayland that works very poorly
172 "windowmaker"
173 "nss-certs"
174 "docker-compose"
175 "thinkfan"
176 "cpupower"
177 "lm-sensors"
178 "x86-energy-perf-policy"
179 "git"
180 "stow"
181 "lm-sensors"
182 "xset"
183 "cpuid"
184 ;; Video Codecs stuff
185 "gstreamer"
186 "gst-plugins-base"
187 "gst-plugins-good"
188 "gst-plugins-bad"
189 "gst-plugins-ugly"
190 "gst-libav"
191 ;; "intel-vaapi-driver-g45-h264"
192 "libva-utils"
193 "igt-gpu-tools"
194 ;; Xorg
195 "xev"
196 "xset"
197 "xrdb"
198 "xhost"
199 "xmodmap"
200 "setxkbmap"
201 "xrandr"
202 "arandr"
203 "xss-lock"
204 "libinput"
205 "xinput"
206 "xf86-input-libinput"
207 ;; "xf86-video-fbdev"
208 "xf86-video-intel"
209 "qemu"))
210 %base-packages))
211
212 (services
213 (cons*
214 (service docker-service-type)
215 (service virtlog-service-type)
216 (service libvirt-service-type
217 (libvirt-configuration (unix-sock-group "libvirt")))
218 (service openssh-service-type)
219 (service tor-service-type)
220
221 ;;Wacom tablet support
222 (service inputattach-service-type
223 (inputattach-configuration
224 (device "/dev/ttyS4")
225 (device-type "wacom")))
226
227 (service kernel-module-loader-service-type
228 '("thinkpad_acpi"
229 "msr"
230 "coretemp"
231 "acpi_cpufreq"
232 "overlay"))
233
234 (simple-service 'thinkpad-acpi-config etc-service-type
235 (list `("modprobe.d/thinkpad_acpi.conf"
236 ,thinkpad-acpi-config)))
237
238 (simple-service 'fancontrol-config etc-service-type
239 (list `("fancontrol"
240 ,fancontrol-config)))
241
242 (simple-service 'thinkfan-config etc-service-type
243 (list `("thinkfan.conf"
244 ,thinkfan-config)))
245
246 (simple-service 'i915-config etc-service-type
247 (list `("modprobe.d/i915.conf"
248 ,i915-config)))
249
250 (simple-service 'drm-kms-config etc-service-type
251 (list `("modprobe.d/drm_kms.conf"
252 ,drm-kms-config)))
253
254 ;; (service openvpn-client-service-type
255 ;; (openvpn-client-configuration
256 ;; (persist-tun? #t)
257 ;; (remote
258 ;; (list
259 ;; (openvpn-remote-configuration
260 ;; (name "nyc.vpn.riseup.net")
261 ;; (port 1196))))))
262
263 (service special-files-service-type
264 `(("/bin/bash" ,(file-append bash "/bin/bash"))
265 ("/bin/python" ,(file-append python "/bin/python3"))
266 ("/bin/python3" ,(file-append python "/bin/python3"))
267 ("/bin/awk" ,(file-append gawk "/usr/bin/awk"))
268 ("/usr/bin/awk" ,(file-append gawk "/usr/bin/awk"))
269 ("/lib64/ld-linux-x86-64.so.2"
270 ,(file-append (canonical-package glibc)
271 "/lib/ld-linux-x86-64.so.2"))))
272
273 (service nix-service-type
274 (nix-configuration
275 (extra-config '("trusted-users = root w96k"))))
276
277 (service postgresql-service-type)
278
279 %cpupower-service
280
281 ;; Doesn't start on boot sadly :(
282 %thinkfan-service
283
284 %x86-energy-perf-policy-service
285
286 (screen-locker-service xlockmore "xlock")
287
288
289 ;; (service xorg-server-service-type
290 ;; (xorg-configuration
291 ;; (keyboard-layout keyboard-layout)))
292
293 (service hurd-vm-service-type
294 (hurd-vm-configuration
295 (disk-size (* 8 (expt 2 30))) ;12GiB
296 (memory-size 1024)))
297
298 (service slim-service-type
299 (slim-configuration
300 (xorg-configuration
301 (xorg-configuration
302 (drivers '("modesetting"))
303 (keyboard-layout keyboard-layout)))))
304
305
306 (modify-services %desktop-services
307 (delete gdm-service-type)
308 ;; (network-manager-service-type config =>
309 ;; (network-manager-configuration
310 ;; (inherit config)
311 ;; (vpn-plugins (list network-manager-openvpn))))
312 ;; (guix-service-type
313;; config =>
314;; (guix-configuration
315;; (inherit config)
316;; (substitute-urls
317;; (list "http://ci.guix.trop.in"
318;; ;; "https://4zwzi66wwdaalbhgnix55ea3ab4pvvw66ll2ow53kjub6se4q2bclcyd.onion"
319;; "https://bordeaux.guix.gnu.org"
320;; "https://substitutes.nonguix.org"))
321;; (authorized-keys
322;; (append (list
323;; (plain-file "non-guix.pub"
324;; "(public-key
325;; (ecc
326;; (curve Ed25519)
327;; (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)
328;; )
329;; )")
330;; (plain-file "yunohost.pub"
331;; "(public-key
332;; (ecc
333;; (curve Ed25519)
334;; (q #32F6DB936016E836C4A888F217C430C0F40A051864F59A47FC218F991233750D#)
335;; )
336;; )"))
337;; %default-authorized-guix-keys))
338;; ;; (http-proxy "http://localhost:9250")
339;; ))
340 )))
341
342 (bootloader
343 (bootloader-configuration
344 (bootloader grub-bootloader)
345 (target "/dev/sda")
346 (keyboard-layout keyboard-layout)))
347 (swap-devices
348 (list
349 (swap-space
350 (target "/dev/sda1"))))
351 (file-systems
352 (cons*
353 (file-system
354 (mount-point "/")
355 (device
356 (uuid "c184f446-df67-4103-b28e-465ac8776f10"
357 'ext4))
358 (type "ext4")
359 (options "discard"))
360
361 ;; Thinkpad doc HDD
362
363 ;;(file-system
364 ;;(mount-point "/media/hdd/")
365 ;;(device
366 ;; (uuid "71cb0818-baf3-4f7f-8bc2-7e2b0cca3488"
367 ;; 'ext4))
368 ;; (type "ext4"))
369
370 %base-file-systems)))
Note: See TracBrowser for help on using the repository browser.