From fee0bced7fec2f9950957976a28f033edd4f877c Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Sat, 2 Oct 2021 19:05:02 +0300 Subject: 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. --- tests/guix-home.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'tests/guix-home.sh') diff --git a/tests/guix-home.sh b/tests/guix-home.sh index 0b5deabeb0..e578559c97 100644 --- a/tests/guix-home.sh +++ b/tests/guix-home.sh @@ -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" # -- cgit 1.4.1