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. ;; utilisées dans cette configuration.
(use-modules (gnu)) (use-modules (gnu))
(use-modules (srfi srfi-1)) (use-modules (srfi srfi-1))
(use-modules (gnu system setuid) (gnu packages cups)) (use-modules (gnu system setuid)
(use-service-modules cups desktop networking ssh xorg virtualization vpn security-token) (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 ;; Configuration sudoer personnalisée
(define %sudoers-specification (define %sudoers-specification
@ -51,6 +62,27 @@ LABEL=\"gnupg_rules_end\"
KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK+=\"nitrospace\" 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 ;; Configuration du système
;; C'est le point d'entrée de la configuration ;; C'est le point d'entrée de la configuration
(operating-system (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) ;; Application de la configuration sudoer personnalisée (définie plus haut)
(kernel-arguments (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) (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. ;; Quelques paquets installés au niveau du système.
;; On installe notamment network-manager et son extension pour openvpn, ;; On installe notamment network-manager et son extension pour openvpn,
;; ou encore libvirt/virt-manager pour la virtualisation ;; ou encore libvirt/virt-manager pour la virtualisation
(packages (append (list (specification->package "nss-certs") (packages (append (list (specification->package "qemu")
(specification->package "qemu")
(specification->package "virt-manager") (specification->package "virt-manager")
(specification->package "libvirt") (specification->package "libvirt")
(specification->package "lm-sensors")
(specification->package "lvm2") (specification->package "lvm2")
(specification->package "mdadm") (specification->package "mdadm")
(specification->package "network-manager") (specification->package "network-manager")
@ -109,6 +141,9 @@ KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK
(modify-services (append (list (modify-services (append (list
(service gnome-desktop-service-type) (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 de gestion des clés de chiffrement physique
(service pcscd-service-type) (service pcscd-service-type)
@ -158,44 +193,37 @@ KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK
;; Chargeur de démarrage (GRUB) ;; Chargeur de démarrage (GRUB)
;; On indique ici où il doit être installé et comment le configurer ;; On indique ici où il doit être installé et comment le configurer
(bootloader (bootloader-configuration (bootloader
(bootloader grub-efi-bootloader) (bootloader-configuration
(targets (list "/boot/efi")) (bootloader grub-bootloader)
(keyboard-layout keyboard-layout))) (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 ;; Périphériques mappés
;; On configure notamment ici les partitions chiffrées (LUKS) ;; On configure notamment ici les partitions chiffrées (LUKS)
(mapped-devices (mapped-devices
(list (list
(mapped-device (mapped-device
(source "HOMERAID") (source "/dev/nvme0n1p3")
(target "HOMERAID-HOMERAID_data") (target "luks-d1673001-bea6-4d19-8ed7-88e3643aac3e")
(type lvm-device-mapping))
(mapped-device
(source "/dev/mapper/HOMERAID-HOMERAID_data")
(target "luks-f0a72a6c-499b-4445-8d13-21dc99337752")
(type luks-device-mapping)))) (type luks-device-mapping))))
;; La liste des systèmes de fichiers montés au démarrage ;; 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 ;; On configure ici le montage des partitions chiffrées et non chiffrées
(file-systems (file-systems
(cons* (cons*
(file-system
(mount-point "/wiab")
(device (uuid "2a13cf03-fc71-44ac-8e1a-d6744201336f" 'ext4))
(create-mount-point? #t)
(type "ext4"))
(file-system (file-system
(mount-point "/") (mount-point "/")
(device (uuid "2e44f3f7-bb6b-43ac-933a-e8992bf10d29" 'ext4)) (device (uuid "2e44f3f7-bb6b-43ac-933a-e8992bf10d29" 'ext4))
(type "ext4")) (type "ext4"))
(file-system (file-system
(mount-point "/home") (mount-point "/home")
(device "/dev/mapper/luks-f0a72a6c-499b-4445-8d13-21dc99337752") (device "/dev/mapper/luks-d1673001-bea6-4d19-8ed7-88e3643aac3e")
(type "ext4") (type "ext4")
(dependencies mapped-devices)) (dependencies mapped-devices))
(file-system
(mount-point "/boot/efi")
(device (uuid "DC58-946E" 'fat32))
(type "vfat"))
%base-file-systems))) %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