From 24bd0ccea199d41ae717bd560cc939d82e6e1b68 Mon Sep 17 00:00:00 2001 From: Marek Paśnikowski Date: Mon, 26 Sep 2022 17:32:42 +0200 Subject: Guix Home: optimize configuration path prefix The common configuration path prefix can be defined in a single variable. - Define `config-prefix` variable. - Use the new variable in the `reconfigure-home` alias. - Use the new variable in the `reconfigure-system` alias. - Use the new variable in the `bash_profile` link. - Use the new variable in the `bashrc` link. --- home-configuration.scm | 85 ++++++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/home-configuration.scm b/home-configuration.scm index 4e9532e..647bba5 100644 --- a/home-configuration.scm +++ b/home-configuration.scm @@ -5,43 +5,48 @@ (gnu services) (guix gexp)) -(home-environment (packages (map (compose list - specification->package+output) - (list "cpupower" - "dconf-editor" - "emacs-no-x" - "emacs-ac-geiser" - "emacs-aggressive-indent" - "emacs-geiser" - "emacs-geiser-guile" - "emacs-iedit" - "emacs-multiple-cursors" - "emacs-paredit" - "font-google-noto" - "git" - "git-lfs" - "gnome-tweaks" - "gnupg" - "libreoffice" - "pwgen" - "seahorse" - "trezor-agent"))) - (services (list (service home-bash-service-type - (home-bash-configuration (environment-variables '(("EDITOR" . "emacs") - ("NVM_DIR" . "$HOME/src/nvm") - ("GUILE_AUTO_COMPILE" . "0"))) - (aliases '(("grep" . "grep --color=auto") - ("ll" . "ls -l") - ("ls" . "ls -p --color=auto") - ("reconfigure-home" . "guix home reconfigure ~/src/guix-config/home-configuration.scm") - ("reconfigure-system" . "sudo guix system reconfigure ~/src/guix-config/system-configuration.scm"))) - (bash-profile (list (local-file "/home/marek/src/guix-config/.bash_profile" - "bash_profile"))) - (bashrc (list (local-file "/home/marek/src/guix-config/.bashrc" - "bashrc") - (local-file "/home/marek/src/guix-config/nvm_init" - "nvm_init"))))) - (simple-service 'dot-files - home-files-service-type - (list `(".emacs" ,(local-file "emacs.el")) - `(".ssh/config" ,(local-file "ssh.config"))))))) +(let ([config-prefix "/home/marek/src/guix-config/"]) + (home-environment (packages (map (compose list + specification->package+output) + '("cpupower" + "dconf-editor" + "emacs-no-x" + "emacs-ac-geiser" + "emacs-aggressive-indent" + "emacs-geiser" + "emacs-geiser-guile" + "emacs-iedit" + "emacs-multiple-cursors" + "emacs-paredit" + "font-google-noto" + "git" + "git-lfs" + "gnome-tweaks" + "gnupg" + "libreoffice" + "pwgen" + "seahorse" + "trezor-agent"))) + (services `(,(service home-bash-service-type + (home-bash-configuration (environment-variables '(("EDITOR" . "emacs") + ("NVM_DIR" . "$HOME/src/nvm") + ("GUILE_AUTO_COMPILE" . "0"))) + (aliases `(("grep" . "grep --color=auto") + ("ll" . "ls -l") + ("ls" . "ls -p --color=auto") + ("reconfigure-home" . (string-append "guix home reconfigure " + ,config-prefix + "home-configuration.scm")) + ("reconfigure-system" . (string-append "sudo guix system reconfigure " + ,config-prefix + "system-configuration.scm")))) + (bash-profile `(,(local-file (string-append config-prefix + ".bash_profile") + "bash_profile"))) + (bashrc `(,(local-file (string-append config-prefix + ".bashrc") + "bashrc"))))) + ,(simple-service 'dot-files + home-files-service-type + (list `(".emacs" ,(local-file "emacs.el")) + `(".ssh/config" ,(local-file "ssh.config")))))))) -- cgit v1.2.3