Commit graph

18 commits

Author SHA1 Message Date
Josselin Poiret
4fefbd4f14
tests: guix-home: Fix description search for home-mcron.
* tests/guix-home.sh: home-mcron has changed description, adapt the search.
2023-08-25 17:45:47 +02:00
Ludovic Courtès
7d9fdfb19d
home: services: bash: Properly quote shell aliases.
Fixes <https://issues.guix.gnu.org/63048>.
Reported by Ekaitz Zarraga <ekaitz@elenq.tech>.

* gnu/home/services.scm (with-shell-quotation-bindings): New procedure.
(environment-variable-shell-definitions): Use it instead of inline copy.
* gnu/home/services/shells.scm (bash-serialize-aliases): Use it.  Add
clause for 'literal-string?'.
* tests/guix-home.sh: Add 'aliases' to 'home-bash-extension' and test it.
2023-07-11 15:47:56 +02:00
Eric Bavier
37dd69b445
tests: Fix checks for expected failures.
Addresses <https://issues.guix.gnu.org/62406>.

With 'set -e', a return status inverted with '!' does not cause the shell to
exit immediately.  Instead use '&& false' to indicate an expected failure.

* tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh,
tests/guix-daemon.sh, tests/guix-download.sh,
tests/guix-environment-container.sh, tests/guix-environment.sh,
tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh,
tests/guix-hash.sh, tests/guix-home.sh, tests/guix-pack-relocatable.sh,
tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh,
tests/guix-package.sh, tests/guix-refresh.sh, tests/guix-shell.sh,
tests/guix-style.sh, tests/guix-system.sh: Replace uses of '! ...' with
'... && false' or `test ! ...` as appropriate.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-04-21 16:16:38 +02:00
Ting-Wei Lan
f5c62f106d
tests: Fix guix-home.sh when guix isn't installed
* tests/guix-home.sh: Reorder NIX_STORE_DIR variable definition to
prevent guix from crashing due to missing /gnu/store.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-03-26 23:25:34 +02:00
Andrew Tropin
35ecbb418c
home: environment-variables: Fix escaping.
* gnu/home/services.scm (environment-variable-shell-definitions): Fix
escaping.
* tests/guix-home.sh: Add STRING_WITH_ESCAPES environment variable and test
its value.

Reported-by: elevnkb
2023-01-09 12:22:56 +04:00
Andrew Tropin
2acce55a00
home: environment-variables: Return support for file-likes and gexps.
* gnu/home/services.scm (environment-variable-shell-definitions): Add support
for file-likes and gexps.
* tests/guix-home.sh: Add SHELL environment variable and test its value.  Add
BUILDHOSTTIME environment variable.
2023-01-09 12:03:32 +04:00
Ludovic Courtès
73684dc90e
home: services: environment-variables: Add support for literal strings.
* gnu/home/services.scm (<literal-string>): New record type.
(environment-variable-shell-definitions): Split 'shell-quote' into
'quote-string' and 'shell-double-quote'.  Add 'shell-single-quote'.
Add clause for 'literal-string' records.
* tests/guix-home.sh: Test it.
* doc/guix.texi (Essential Home Services): Document it.
2023-01-05 14:20:23 +01:00
Andrew Tropin
4337e8466e
tests: Make tests inside container reproducible.
* tests/guix-home.sh: Make tests inside container reproducible.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-08-05 15:28:03 +02:00
Ludovic Courtès
af4c103595
home: services: environment-variables: Double-quote values.
Fixes <https://issues.guix.gnu.org/54469>.
Reported by Maxime Devos <maximedevos@telenet.be>.

* gnu/home/services.scm (environment-variable-shell-definitions): New
procedure, with code formerly in 'serialize-posix-env-vars'.
(environment-variables->setup-environment-script): Change
"setup-environment" from 'mixed-text-file' to 'computed-file', and use
'environment-variable-shell-definitions'.
* tests/guix-home.sh: Test it.
* gnu/home/services/shells.scm (serialize-posix-env-vars): Delegate to
'environment-variable-shell-definitions'.
2022-07-14 01:05:34 +02:00
Ludovic Courtès
8af749224f
home: services: shells: Double-quote environment variable values.
Fixes <https://issues.guix.gnu.org/56540>.

Until now, environment variable values were emitted unquoted, producing
invalid shell code if the value contains spaces for example.

* gnu/home/services/shells.scm (serialize-posix-env-vars): Define
'shell-quote' procedure in staged code and use it for #$value.
* tests/guix-home.sh: Add test for PS1 variable with a value containing
spaces.
2022-07-14 01:05:34 +02:00
Ludovic Courtès
d4af1ff177
tests: Adjust 'guix home' test to 'home-files-service-type' changes.
This is a followup to 5832d9fb60.

* tests/guix-home.sh: Change "config" to ".config" in
'home-files-service-type' extension.
2022-04-19 18:07:49 +02:00
Ludovic Courtès
094a2cfbe4
guix home: Add 'container' command.
* guix/scripts/home.scm (show-help, %options): Add '--network',
'--share', and '--expose'.
(not-config?, user-shell, spawn-home-container): New procedures.
(%default-system-profile): New variable.
(perform-action): Add #:file-system-mappings, #:container-command,
and #:network?; honor them.
(process-action): Adjust accordingly.
(guix-home)[parse-sub-command]: Add "container".
[parse-args]: New procedure.
Use it instead of 'parse-command-line'.
* tests/guix-home.sh: Add tests.
* doc/guix.texi (Declaring the Home Environment): Mention 'guix home
container' as a way to test configuration.
(Invoking guix home): Document it.
2022-03-19 18:51:09 +01:00
Ludovic Courtès
25261cbf96
guix home: Implement the 'extension-graph' and 'shepherd-graph' actions.
Until now these two actions were silently ignored.

* guix/scripts/home.scm (show-help, %options): Add "--graph-backend".
(%default-options): Add 'graph-backend' key.
(export-extension-graph, export-shepherd-graph): New procedures.
(perform-action): Add #:graph-backend parameter.  Add cases for the
'extension-graph' and 'shepherd-graph' actions.
(process-action): Pass #:graph-backend to 'perform-action'.
* guix/scripts/system.scm (service-node-type)
(shepherd-service-node-type): Export
* tests/guix-home.sh: Add tests.
* doc/guix.texi (Invoking guix home): Document it.
2022-03-18 16:03:33 +01:00
Ludovic Courtès
5fabaf1128
tests: Check 'guix home reconfigure' for a second generation.
* tests/guix-home.sh: Invoke "guix home reconfigure" a second time with
a modify config file and check the result.
2022-03-10 11:43:14 +01:00
Ludovic Courtès
26e67e0280
tests: Simplify use of 'local-file' in 'tests/guix-home.sh'.
* tests/guix-home.sh: Remove 'current-filename' trickery since
'local-file' resolves file names relative to the containing file.
2022-03-10 11:43:14 +01:00
Ludovic Courtès
7b7e32d5ad
tests: Make sure 'guix home reconfigure' backs up files.
* tests/guix-home.sh: Create ~/.bashrc and ~/.config/test.conf prior to
'reconfigure' and check whether they were backed up.
2022-03-10 11:43:14 +01:00
Oleg Pykhalov
fee0bced7f
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.
2021-10-09 19:24:19 +03:00
Oleg Pykhalov
5e68f7a7b3
tests: Add guix-home.sh.
* tests/guix-home.sh: New file.
* Makefile.am (SH_TESTS): Add this.
2021-10-09 19:24:19 +03:00