diff options
author | Marek Paśnikowski <marekpasnikowski@protonmail.com> | 2022-09-26 17:32:42 +0200 |
---|---|---|
committer | Marek Paśnikowski <marekpasnikowski@protonmail.com> | 2022-09-28 21:59:32 +0200 |
commit | 24bd0ccea199d41ae717bd560cc939d82e6e1b68 (patch) | |
tree | d24b783d6c85e1a015943b011b958fd1cef44f90 | |
parent | 4dadb921e9bb28ed9053cea94c69ea455a7801d7 (diff) |
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.
-rw-r--r-- | home-configuration.scm | 85 |
1 files 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")))))))) |