config avec home intégré

This commit is contained in:
Adrien Bourmault 2024-07-17 15:49:14 +02:00
parent fdb121e0a2
commit 71c5fc9152
No known key found for this signature in database
GPG Key ID: 57BC26A3687116F6
1 changed files with 90 additions and 6 deletions

View File

@ -19,10 +19,29 @@
;; Indique quels modules importer pour accéder aux variables ;; Indique quels modules importer pour accéder aux variables
;; utilisées dans cette configuration. ;; utilisées dans cette configuration.
(use-modules (gnu)) (use-modules
(use-modules (gnu packages freedesktop) (gnu packages cups)) (gnu)
(use-modules (srfi srfi-1)) (gnu home)
(use-service-modules cups desktop networking ssh xorg virtualization vpn security-token) (gnu home services shells)
(gnu home services gnupg)
(gnu packages)
(gnu packages gnupg)
(gnu packages freedesktop)
(gnu packages cups)
(gnu services)
(srfi srfi-1)
(guix gexp))
(use-service-modules
cups
desktop
guix
networking
ssh
xorg
virtualization
vpn
security-token)
;; Configuration sudoer personnalisée ;; Configuration sudoer personnalisée
(define %sudoers-specification (define %sudoers-specification
@ -60,6 +79,65 @@ 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\"
"))) ")))
(define %bashrc_content
(plain-file "bashrc" "\
if [ -n \"$GUIX_ENVIRONMENT\" ]
then
PS1='\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\] [env] \\$ '
else
PS1='\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ '
fi
if [[ ! -n \"$SSH_CLIENT\" ]]; then
unset SSH_AGENT_PID
if [ \"${gnupg_SSH_AUTH_SOCK_by:-0}\" -ne $$ ]; then
export SSH_AUTH_SOCK=\"$(gpgconf --list-dirs agent-ssh-socket)\"
fi
fi"))
(define %profile_content
(plain-file "profile" "\
if [[ ! -n \"$SSH_CLIENT\" ]]; then
unset SSH_AGENT_PID
if [ \"${gnupg_SSH_AUTH_SOCK_by:-0}\" -ne $$ ]; then
export SSH_AUTH_SOCK=\"$(gpgconf --list-dirs agent-ssh-socket)\"
fi
fi"))
(define %home_configuration
(home-environment
(services
(list
(service home-bash-service-type
(home-bash-configuration
(environment-variables
'(
("BSD_GAMES_DIR" . "~/.local/share/bsd-games")
("GCC_COLORS" . "'error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'")
("GUIX_PACKAGE_PATH" . "$HOME/.config/guix/packages/defs")
("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share")
("LV2_PATH" . "$HOME/.guix-profile/lib/lv2")))
(aliases
'(
("clear" . "printf '\\033c'")
("dir" . "dir --color=auto")
("egrep" . "grep -E --color=auto")
("fgrep" . "grep -F --color=auto")
("grep" . "grep --color=auto")
("la" . "ls -lthA -p --color=auto")
("ll" . "ls -lth -p --color=auto")
("ls" . "ls -p --color=auto")
("vdir" . "vdir --color=auto")))
(bashrc
(list
%bashrc_content))))
(service home-gpg-agent-service-type
(home-gpg-agent-configuration
(pinentry-program
(file-append pinentry-gnome3 "/bin/pinentry-gnome3"))
(ssh-support? #t)))))))
;; 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
@ -260,7 +338,6 @@ KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK
"xdot" "xdot"
"xdotool" "xdotool"
"xeyes" "xeyes"
"xmlcopyeditor"
"xournalpp" "xournalpp"
"xrdp" "xrdp"
"yt-dlp" "yt-dlp"
@ -273,7 +350,11 @@ KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK
(modify-services (modify-services
(append (append
(list (list
(service gnome-desktop-service-type) ;; Service guix home (reconfiguration auto des profils)
(service guix-home-service-type
`(("neox" ,%home_configuration)))
;; Service bluetooth
(service bluetooth-service-type) (service bluetooth-service-type)
;; Service de gestion des clés de chiffrement physique ;; Service de gestion des clés de chiffrement physique
@ -307,6 +388,9 @@ KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK
(pam-limits-entry "@audio" 'both 'rtprio 99) (pam-limits-entry "@audio" 'both 'rtprio 99)
(pam-limits-entry "@audio" 'both 'memlock 'unlimited))) (pam-limits-entry "@audio" 'both 'memlock 'unlimited)))
;; Service Gnome/GDM
(service gnome-desktop-service-type)
;; Configuration de l'environnement graphique (notamment clavier) ;; Configuration de l'environnement graphique (notamment clavier)
(set-xorg-configuration (set-xorg-configuration
(xorg-configuration (keyboard-layout keyboard-layout)))) (xorg-configuration (keyboard-layout keyboard-layout))))