added fancontrol

This commit is contained in:
Adrien Bourmault 2024-05-09 12:53:57 +02:00
parent 2e41aca1b5
commit 5088950feb
2 changed files with 66 additions and 27 deletions

View File

@ -11,8 +11,19 @@
;; utilisées dans cette configuration.
(use-modules (gnu))
(use-modules (srfi srfi-1))
(use-modules (gnu system setuid) (gnu packages cups))
(use-service-modules cups desktop networking ssh xorg virtualization vpn security-token)
(use-modules (gnu system setuid)
(gnu packages cups)
(gnu packages admin)
(gnu services shepherd))
(use-service-modules cups
desktop
networking
ssh
xorg
virtualization
vpn
security-token)
;; Configuration sudoer personnalisée
(define %sudoers-specification
@ -51,6 +62,27 @@ LABEL=\"gnupg_rules_end\"
KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK+=\"nitrospace\"
")))
;; Définition du service de contrôle des ventilateurs
(define (fancontrol-shepherd-service cfg-path)
(shepherd-service
(documentation "Run the fancontrol daemon (fancontrol-daemon)." )
(provision '(fancontrol))
(requirement '(udev user-processes))
(start #~(make-forkexec-constructor
(list #$(file-append (specification->package "lm-sensors") "/sbin/fancontrol")
#$cfg-path)
#:user "root" #:group "root"
#:log-file "/var/log/fancontrol.log"))
(stop #~(make-kill-destructor))))
(define fancontrol-service-type
(service-type
(name 'fancontrol)
(description
"Run fancontrol as a daemon.")
(extensions
(list (service-extension shepherd-root-service-type
(compose list fancontrol-shepherd-service))))))
;; Configuration du système
;; C'est le point d'entrée de la configuration
(operating-system
@ -61,9 +93,9 @@ KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK
;; Application de la configuration sudoer personnalisée (définie plus haut)
(kernel-arguments
(list "modprobe.blacklist=pcspkr,usbmouse,usbkbd" "iommu=pt" "nouveau.config=NvClkMode=15"))
(list "nohz=on" "libata.force=noncq" "modprobe.blacklist=pcspkr,usbmouse,usbkbd" "iommu=pt" "nouveau.config=NvClkMode=15"))
(initrd-modules (append (list "vfio-pci" "vfio_iommu_type1" "dm-raid" "dm-cache" "dm-crypt") %base-initrd-modules))
(initrd-modules (append (list "w83795" "vfio-pci" "vfio_iommu_type1" "dm-raid" "dm-cache" "dm-crypt") %base-initrd-modules))
(sudoers-file %sudoers-specification)
@ -91,10 +123,10 @@ KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK
;; Quelques paquets installés au niveau du système.
;; On installe notamment network-manager et son extension pour openvpn,
;; ou encore libvirt/virt-manager pour la virtualisation
(packages (append (list (specification->package "nss-certs")
(specification->package "qemu")
(packages (append (list (specification->package "qemu")
(specification->package "virt-manager")
(specification->package "libvirt")
(specification->package "libvirt")
(specification->package "lm-sensors")
(specification->package "lvm2")
(specification->package "mdadm")
(specification->package "network-manager")
@ -108,6 +140,9 @@ KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK
(services
(modify-services (append (list
(service gnome-desktop-service-type)
;; Service de contrôle des ventilateurs
(service fancontrol-service-type "/etc/fancontrol")
;; Service de gestion des clés de chiffrement physique
(service pcscd-service-type)
@ -158,44 +193,37 @@ KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK
;; Chargeur de démarrage (GRUB)
;; On indique ici où il doit être installé et comment le configurer
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets (list "/boot/efi"))
(keyboard-layout keyboard-layout)))
(bootloader
(bootloader-configuration
(bootloader grub-bootloader)
(targets (list "/dev/nvme0n1"))
(terminal-outputs '(console))
(keyboard-layout keyboard-layout)
(theme
(grub-theme
(inherit (grub-theme))
(gfxmode '("640x480-24"))))))
;; Périphériques mappés
;; On configure notamment ici les partitions chiffrées (LUKS)
(mapped-devices
(list
(mapped-device
(source "HOMERAID")
(target "HOMERAID-HOMERAID_data")
(type lvm-device-mapping))
(mapped-device
(source "/dev/mapper/HOMERAID-HOMERAID_data")
(target "luks-f0a72a6c-499b-4445-8d13-21dc99337752")
(source "/dev/nvme0n1p3")
(target "luks-d1673001-bea6-4d19-8ed7-88e3643aac3e")
(type luks-device-mapping))))
;; La liste des systèmes de fichiers montés au démarrage
;; On configure ici le montage des partitions chiffrées et non chiffrées
(file-systems
(cons*
(file-system
(mount-point "/wiab")
(device (uuid "2a13cf03-fc71-44ac-8e1a-d6744201336f" 'ext4))
(create-mount-point? #t)
(type "ext4"))
(file-system
(mount-point "/")
(device (uuid "2e44f3f7-bb6b-43ac-933a-e8992bf10d29" 'ext4))
(type "ext4"))
(file-system
(mount-point "/home")
(device "/dev/mapper/luks-f0a72a6c-499b-4445-8d13-21dc99337752")
(device "/dev/mapper/luks-d1673001-bea6-4d19-8ed7-88e3643aac3e")
(type "ext4")
(dependencies mapped-devices))
(file-system
(mount-point "/boot/efi")
(device (uuid "DC58-946E" 'fat32))
(type "vfat"))
%base-file-systems)))

11
fancontrol Normal file
View File

@ -0,0 +1,11 @@
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
DEVPATH=hwmon7=devices/pci0000:00/0000:00:14.0/i2c-1/1-002f
DEVNAME=hwmon7=w83795g
FCTEMPS= hwmon7/device/pwm1=hwmon7/device/temp7_input
FCFANS= hwmon7/device/pwm1=hwmon7/device/fan2_input+hwmon7/device/fan1_input
MINTEMP= hwmon7/device/pwm1=20
MAXTEMP= hwmon7/device/pwm1=60
MINSTART= hwmon7/device/pwm1=150
MINSTOP= hwmon7/device/pwm1=0
AVERAGE=4