1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-13 18:40:57 +02:00

home: services: configuration: Support file-like objects.

* gnu/home/services/configuration.scm (interpose): Operate only with file-like
objects.
(string-or-gexp?): Delete procedure.
(serialize-string-or-gexp): Rename to 'serialize-file-like'.
(text-config?): Call 'file-like' intead of 'string-or-gexp?'.
* guix/scripts/home/import.scm:
(generate-bash-module+configuration): Don't call slurp-file-gexp.
* gnu/home/services/configuration.scm: Move content ...
* gnu/services/configuration.scm: here.
* gnu/home/services/shells.scm: Delete (gnu home services configuration).
* gnu/home/services/xdg.scm: Same.
* gnu/local.mk: Same.
* tests/guix-home.sh:
Test home-bash-service-type and extension with home-bash-extension.
This commit is contained in:
Oleg Pykhalov 2021-10-02 19:05:02 +03:00
parent 5e68f7a7b3
commit fee0bced7f
No known key found for this signature in database
GPG key ID: 167F8EA5001AFA9C
7 changed files with 117 additions and 120 deletions

View file

@ -54,10 +54,13 @@ trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT
# Test 'guix home reconfigure'.
#
printf "# dot-bashrc test file for guix home" > "dot-bashrc"
cat > "home.scm" <<'EOF'
(use-modules (guix gexp)
(gnu home)
(gnu home services)
(gnu home services shells)
(gnu services))
(home-environment
@ -68,11 +71,33 @@ trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT
(list `("config/test.conf"
,(plain-file
"tmp-file.txt"
"the content of ~/.config/test.conf")))))))
"the content of ~/.config/test.conf"))))
(service home-bash-service-type
(home-bash-configuration
(guix-defaults? #t)
(bashrc
(list
(local-file (string-append (dirname (current-filename))
"/dot-bashrc"))))))
(simple-service 'home-bash-service-extension-test
home-bash-service-type
(home-bash-extension
(bashrc
(list
(plain-file
"bashrc-test-config.sh"
"# the content of bashrc-test-config.sh"))))))))
EOF
guix home reconfigure "${test_directory}/home.scm"
test -d "${HOME}/.guix-home"
test -h "${HOME}/.bash_profile"
test -h "${HOME}/.bashrc"
test "$(tail -n 2 "${HOME}/.bashrc")" == "\
# dot-bashrc test file for guix home
# the content of bashrc-test-config.sh"
grep -q "the content of ~/.config/test.conf" "${HOME}/.config/test.conf"
#