source: dotfiles/guix/config-thinkpad.scm@ 254aa1d

Last change on this file since 254aa1d was 254aa1d, checked in by Mikhail Kirillov <w96k@…>, on Aug 5, 2024 at 6:53:43 AM

Massively update guix home

  • Property mode set to 100644
File size: 8.5 KB
RevLine 
[3a705ab]1;; -*- geiser-scheme-implementation: guile -*-
2
[dab424a]3(use-modules (gnu)
[3a705ab]4 (gnu packages)
5 (srfi srfi-1))
[c39b1a4]6
[4d7b63b]7(use-service-modules
8 desktop
[c53d99e]9 databases
[dab424a]10 networking
11 ssh
12 xorg
[68afd91]13 docker
[cc8263e]14 virtualization
[fcd469c]15 dbus
[d69a858]16 linux
[1f113e1]17 pm
[d69a858]18 vpn
[dab424a]19 nix)
[c39b1a4]20
[fcd469c]21(use-package-modules
22 wm
23 lisp
24 bash
25 linux
26 python
[d69a858]27 gnome
[6cbb9a9]28 gawk
[e17c508]29 xorg
[fcd469c]30 xdisorg)
[bfc3f15]31
[bec93c6]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
[b66cfce]40(define %cpupower-service
41 (simple-service
42 'cpupower activation-service-type
43 #~(zero? (system* #$(file-append cpupower "/bin/cpupower")
[c53d99e]44 "frequency-set" "--governor" "schedutil"))))
[1f113e1]45
[68b6dfb]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")
[c53d99e]50 "--turbo-enable" "0"
51 "--hwp-desired" "16"))))
[68b6dfb]52
[fe80e58]53(define %thinkfan-service
54 (simple-service
55 'thinkfan activation-service-type
56 #~(zero? (system* #$(file-append thinkfan "/sbin/thinkfan")))))
57
[cab585f]58
59(define i915-config
60 (plain-file "i915.conf"
[e17c508]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"))
[cab585f]66
[9555e82]67(define thinkpad-acpi-config
[d69a858]68 (plain-file "thinkpad_acpi.conf"
69 "options thinkpad_acpi fan_control=1"))
70
[dbd2492]71;; tp_thermal /proc/acpi/ibm/thermal
[e17c508]72
[9555e82]73(define thinkfan-config
74 (plain-file "thinkfan.conf"
[dbd2492]75 "\
[3a705ab]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
[9555e82]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
[3a705ab]85# hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp3_input
86# hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp2_input
[9555e82]87hwmon /sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp1_input
88hwmon /sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp2_input
[dbd2492]89tp_fan /proc/acpi/ibm/fan
[9555e82]90
[b3d4c33]91(0, 0, 35)
[af8179c]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)"))
[9555e82]100
101(define fancontrol-config
102 (plain-file "fancontrol"
103 "
104INTERVAL=10
[e17c508]105DEVPATH=hwmon0=devices/virtual/thermal/thermal_zone0 hwmon1=devices/platform/thinkpad_hwmon
[9555e82]106DEVNAME=hwmon0=acpitz hwmon5=thinkpad
[e17c508]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"))
[9555e82]114
[dab424a]115(operating-system
[fcd469c]116 (locale "ru_RU.utf8")
[14df2de]117 (timezone "Europe/Tbilisi")
[fcd469c]118 (keyboard-layout
[dab424a]119 (keyboard-layout
[fcd469c]120 "us,ru"
121 #:options
[0d3793b]122 '("grp:shifts_toggle"
[fcd469c]123 "caps:ctrl_modifier")))
[5516569]124 ;; (kernel linux-libre-5.19)
125 ;; (kernel-loadable-modules '(acpi-call-linux-module))
[fcd469c]126 (kernel-arguments
[bec93c6]127 '("consoleblank=0"
[3a705ab]128 ;; "processor.max_cstate=3" ; Disable power savings
129 ;; "intel_idle.max_cstate=0" ; (cstate 3-4 provides
130 ;; ; high freq cpu noice)
[bec93c6]131 "vblank_mode=0"
132 ;;"vm.swappiness=5"
133 "thinkpad_acpi.fan_control=1"
[e17c508]134 "acpi_sleep=s3_bios"
135 "acpi_osi=Linux"
136 "i915.modeset=1"
[3a705ab]137 ;; "i915.enable_dc=0"
138 ;; "i915.enable_psr=0"
[bec93c6]139 "rootfstype=ext4"
140 "KVM"
141 "loglevel=7"
142 ;;"logo"
[e17c508]143 "ahci.mobile_lpm_policy=1"
[bec93c6]144 "intremap=off" ; Fix for failed to map dmar2
145 "modprobe.blacklist=pcspkr,usbmouse,usbkbd,glx"))
146 (host-name "w96k-x200t")
[fcd469c]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
[cab585f]155 '("wheel" "netdev" "audio" "video" "kvm" "docker")))
[fcd469c]156 %base-user-accounts))
157 (packages
158 (append
159 (map
160 specification->package
[bec93c6]161 '("xterm"
[3a705ab]162 "xinit"
163 "xorg-server"
[9ebddde]164 "font-gnu-unifont"
[1c49a32]165 "font-gnu-freefont"
[e17c508]166 "mesa"
167 "mesa-utils"
[b06f3f9]168 "ratpoison"
[c53d99e]169 "wmname"
[1c49a32]170 "windowmaker"
[fcd469c]171 "nss-certs"
[af45e67]172 "docker-compose"
[d69a858]173 "thinkfan"
[b66cfce]174 "cpupower"
[d69a858]175 "lm-sensors"
[68b6dfb]176 "x86-energy-perf-policy"
[fcd469c]177 "git"
178 "stow"
[1f113e1]179 "lm-sensors"
180 "xset"
[50e2f75]181 "cpuid"
182 ;; Video Codecs stuff
183 "gstreamer"
184 "gst-plugins-base"
185 "gst-plugins-good"
186 "gst-plugins-bad"
187 "gst-plugins-ugly"
188 "gst-libav"
[3a705ab]189 ;; "intel-vaapi-driver-g45-h264"
[50e2f75]190 "libva-utils"
[e17c508]191 "igt-gpu-tools"
[50e2f75]192 ;; Xorg
193 "xev"
194 "xset"
195 "xrdb"
196 "xhost"
197 "xmodmap"
198 "setxkbmap"
199 "xrandr"
200 "arandr"
201 "xss-lock"
202 "libinput"
203 "xinput"
204 "xf86-input-libinput"
[3a705ab]205 ;; "xf86-video-fbdev"
206 "xf86-video-intel"
[e17c508]207 "qemu"))
[fcd469c]208 %base-packages))
[bec93c6]209
[fcd469c]210 (services
211 (cons*
[2f98dbb]212 (service docker-service-type)
[5516569]213 (service thermald-service-type)
[14df2de]214 (service virtlog-service-type)
[9ebddde]215 (service libvirt-service-type
[14df2de]216 (libvirt-configuration (unix-sock-group "libvirt")))
[fcd469c]217 (service openssh-service-type)
[3a705ab]218 (service tor-service-type)
[fcd469c]219
220 ;;Wacom tablet support
[d2042a2]221 (service inputattach-service-type
222 (inputattach-configuration
223 (device "/dev/ttyS4")
224 (device-type "wacom")))
[d69a858]225
226 (service kernel-module-loader-service-type
[dbd2492]227 '("thinkpad_acpi"
[8535772]228 "msr"
[68b6dfb]229 "coretemp"
[cab585f]230 "acpi_cpufreq"
231 "overlay"))
[d69a858]232
[9555e82]233 (simple-service 'thinkpad-acpi-config etc-service-type
[d69a858]234 (list `("modprobe.d/thinkpad_acpi.conf"
[9555e82]235 ,thinkpad-acpi-config)))
236
[5516569]237 ;; (simple-service 'fancontrol-config etc-service-type
238 ;; (list `("fancontrol"
239 ;; ,fancontrol-config)))
[9555e82]240
[5516569]241 ;; (simple-service 'thinkfan-config etc-service-type
242 ;; (list `("thinkfan.conf"
243 ;; ,thinkfan-config)))
[cab585f]244
245 (simple-service 'i915-config etc-service-type
246 (list `("modprobe.d/i915.conf"
247 ,i915-config)))
[d69a858]248
[e17c508]249 (simple-service 'drm-kms-config etc-service-type
250 (list `("modprobe.d/drm_kms.conf"
251 ,drm-kms-config)))
252
[c53d99e]253 ;; (service openvpn-client-service-type
254 ;; (openvpn-client-configuration
255 ;; (persist-tun? #t)
256 ;; (remote
257 ;; (list
258 ;; (openvpn-remote-configuration
259 ;; (name "nyc.vpn.riseup.net")
260 ;; (port 1196))))))
[fcd469c]261
[ee435ef]262 (service special-files-service-type
263 `(("/bin/bash" ,(file-append bash "/bin/bash"))
264 ("/bin/python" ,(file-append python "/bin/python3"))
[844edde]265 ("/bin/python3" ,(file-append python "/bin/python3"))
[ee435ef]266 ("/bin/awk" ,(file-append gawk "/usr/bin/awk"))
267 ("/usr/bin/awk" ,(file-append gawk "/usr/bin/awk"))
268 ("/lib64/ld-linux-x86-64.so.2"
269 ,(file-append (canonical-package glibc)
270 "/lib/ld-linux-x86-64.so.2"))))
[dcfa0e4]271
[c53d99e]272 (service nix-service-type
273 (nix-configuration
274 (extra-config '("trusted-users = root w96k"))))
275
276 (service postgresql-service-type)
[1f113e1]277
[b66cfce]278 %cpupower-service
[fe80e58]279
[af45e67]280 ;; Doesn't start on boot sadly :(
[fe80e58]281 %thinkfan-service
[68b6dfb]282
283 %x86-energy-perf-policy-service
[1c49a32]284
[e17c508]285 (screen-locker-service xlockmore "xlock")
286
[af45e67]287
288 ;; (service xorg-server-service-type
289 ;; (xorg-configuration
290 ;; (keyboard-layout keyboard-layout)))
291
[5516569]292 ;; (service hurd-vm-service-type
293 ;; (hurd-vm-configuration
294 ;; (disk-size (* 8 (expt 2 30))) ;12GiB
295 ;; (memory-size 1024)))
[14df2de]296
[fcd469c]297 (service slim-service-type
298 (slim-configuration
299 (xorg-configuration
[b7234fa]300 (xorg-configuration
[e17c508]301 (drivers '("modesetting"))
[fcd469c]302 (keyboard-layout keyboard-layout)))))
[af45e67]303
[3a705ab]304
[d2042a2]305 (modify-services %desktop-services
[5516569]306 (delete gdm-service-type))))
[fcd469c]307
308 (bootloader
309 (bootloader-configuration
310 (bootloader grub-bootloader)
311 (target "/dev/sda")
312 (keyboard-layout keyboard-layout)))
[d2042a2]313 (swap-devices
314 (list
315 (swap-space
316 (target "/dev/sda1"))))
[fcd469c]317 (file-systems
318 (cons*
319 (file-system
320 (mount-point "/")
321 (device
322 (uuid "c184f446-df67-4103-b28e-465ac8776f10"
323 'ext4))
[3a705ab]324 (type "ext4")
325 (options "discard"))
[0979ded]326
327 ;; Thinkpad doc HDD
328
[fcd469c]329 ;;(file-system
330 ;;(mount-point "/media/hdd/")
331 ;;(device
332 ;; (uuid "71cb0818-baf3-4f7f-8bc2-7e2b0cca3488"
333 ;; 'ext4))
334 ;; (type "ext4"))
335
336 %base-file-systems)))
Note: See TracBrowser for help on using the repository browser.