]> git.ekhem.eu.org Git - guix.git/commitdiff
[home] Specify bash dotfiles as strings.
authorJakub Czajka <jakub@ekhem.eu.org>
Fri, 3 Jun 2022 20:38:39 +0000 (22:38 +0200)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:53:07 +0000 (19:53 +0100)
This commit changes bash dotfiles argument type from `local-file` to
`string`. Hide the `local-file` as an implementation detail.

conf/home/bash.scm
home.scm

index e1eb980c71c0258d84e1a36eca031e0732c00425..cc16773188b037c19d378db65cd1257734d7f4fe 100644 (file)
@@ -12,8 +12,7 @@
   #:export (home-bash-configuration
            home-bash-service-type))
 
-;; Local file is already a gexp, so just return in.
-(define (serialize-local-file field-name value)
+(define (serialize-string field-name value)
   value)
 
 (define-configuration home-bash-configuration
    (package bash)
    "Packages to be installed by the service.")
   (bash-profile
-   (local-file)
+   (string)
    "Dotfile for login shells.")
   (bashrc
-   (local-file)
+   (string)
    "Dotfile for interactive non-login shells."))
 
 (define (install-bash-packages config)
 
 (define (symlink-bash-dotfiles config)
   (list `(".bash_profile"
-         ,(home-bash-configuration-bash-profile config))
+         ,(local-file (home-bash-configuration-bash-profile config)
+                      "bash_profile"))
        `(".bashrc"
-         ,(home-bash-configuration-bashrc config))))
+         ,(local-file (home-bash-configuration-bashrc config)
+                      "bashrc"))))
 
 (define home-bash-service-type
   (service-type
index 2e25e08bb7cab2d0d9082b86c359e56a712d3237..ac5b1134225f3aa16eaec0c7700ab0e6c454c91f 100644 (file)
--- a/home.scm
+++ b/home.scm
@@ -13,7 +13,5 @@
  (services
   (list (service home-bash-service-type
                 (home-bash-configuration
-                 ;; `local-file` for a name with a dot causes an error. A
-                 ;; workaround it put a different NAME argument.
-                 (bash-profile (local-file "bash/.bash_profile" "bash_profile"))
-                 (bashrc (local-file "bash/.bashrc" "bashrc")))))))
+                 (bash-profile "bash/.bash_profile")
+                 (bashrc "bash/.bashrc"))))))