summaryrefslogtreecommitdiff
path: root/guix/scripts/home
AgeCommit message (Collapse)Author
2023-02-27ui: 'display-hint' quotes extra arguments for Texinfo.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/61201>. Previously, common practice was to splice arbitrary strings (user names, file names, etc.) into Texinfo snippets passed to 'display-hint'. This is unsafe in the general case because at signs and braces need to be escaped to produced valid Texinfo. This commit addresses that. * guix/ui.scm (texinfo-quote): New procedure. (display-hint): When ARGUMENTS is non-empty, pass it to 'texinfo-quote' and call 'format'. (report-unbound-variable-error, check-module-matches-file) (display-collision-resolution-hint, run-guix-command): Remove explicit 'format' call; pass 'format' arguments as extra arguments to 'display-hint'. * gnu/services/monitoring.scm (zabbix-front-end-config): Likewise. * guix/scripts.scm (warn-about-disk-space): Likewise. * guix/scripts/build.scm (%standard-cross-build-options) (%standard-native-build-options): Likewise. * guix/scripts/describe.scm (display-checkout-info): Likewise. * guix/scripts/environment.scm (suggest-command-name): Likewise. * guix/scripts/home.scm (process-command): Likewise. * guix/scripts/home/edit.scm (service-type-not-found): Likewise. * guix/scripts/import.scm (guix-import): Likewise. * guix/scripts/package.scm (display-search-path-hint): Likewise. * guix/scripts/pull.scm (build-and-install): Likewise. * guix/scripts/shell.scm (auto-detect-manifest): Likewise. * guix/scripts/system.scm (check-file-system-availability): Likewise. (guix-system): Likewise. * guix/scripts/system/edit.scm (service-type-not-found): Likewise. * guix/status.scm (print-build-event): Likewise.
2022-09-20home: import: Use (guix read-print) to render the config file.Ludovic Courtès
* guix/scripts/home/import.scm (manifest+configuration-files->code): Insert calls to 'comment' and 'vertical-space'. (import-manifest): Use 'pretty-print-with-comments/splice' instead of a loop on 'pretty-print'. * tests/home-import.scm (remove-recursively): New procedure. (eval-test-with-home-environment): Use it.
2022-06-06packages: Add 'specifications->packages'.Antero Mejr
* gnu/packages.scm (specifications->packages): New procedure. * guix/scripts/home/import.scm (manifest+configuration-files->code): Use it. * tests/home-import.scm (match-home-environment-no-services) (match-home-environment-no-services-nor-packages) (match-home-environment-bash-service) (match-home-environment-bash-service-with-alias): Adjust 'packages' field accordingly. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-06-04guix home: Add 'edit' sub-command.Ludovic Courtès
* guix/scripts/home/edit.scm: New file. * Makefile.am (MODULES): Add it. * guix/scripts/home.scm (show-help): Add "edit". (process-command): Handle it. (guix-home): Add it. * po/guix/POTFILES.in: Add 'guix/scripts/home/edit.scm'. * doc/guix.texi (Invoking guix home): Document it.
2022-03-20home: import: Clarify alias parsing code.Ludovic Courtès
* guix/scripts/home/import.scm (generate-bash-configuration+modules) [bash-alias->pair]: Return #f on match failure. [parse-aliases]: Adjust accordingly and use 'match'. Remove 'filter' call.
2022-03-20home: import: Properly parse aliases that contain quotes.Ludovic Courtès
* guix/scripts/home/import.scm (generate-bash-configuration+modules): Define 'alias-rx'. [bash-alias->pair]: Use it. * tests/home-import.scm (match-home-environment-bash-service-with-alias): New variable. ("manifest->code: Bash service with aliases"): New test.
2022-01-05home: import: Fix handling of manifest entries with specific output.Arjan Adriaanse
specification->package fails on manifest entries with specific outputs, resulting in an invalid home configuration. This changes the import command to use specification->package+output instead. * guix/scripts/home/import.scm (manifest+configuration-files->code): Make sure manifest entries with specific output are also handled. * tests/home-import.scm: Specify output in home environment manifest entry. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-11-07home: services: bash: Add ‘aliases’ field.Xinglu Chen
* doc/guix.texi (Shells Home Services): Document it. * gnu/home/services/shells.scm (bash-serialize-aliases): New procedure. (home-bash-configuration, home-bash-extension): Add ‘aliases’ field. (home-bash-extensions): Adjust accordingly. * guix/scripts/home/import.scm (generate-bash-configuration+modules): Populate the ‘alias’ field. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-31home: import: Avoid duplication of 'manifest->code'.Ludovic Courtès
* guix/scripts/home/import.scm (manifest->code): Remove. (manifest+configuration-files->code): New procedure. (import-manifest): Use 'manifest+configuration-files->code' instead of 'manifest->code'. * tests/home-import.scm (eval-test-with-home-environment): Likewise. (match-home-environment-transformations): New procedure. ("manifest->code: No services, package transformations"): New test.
2021-10-31home: import: Factorize triplicated 'version-spec' procedure.Ludovic Courtès
* guix/scripts/package.scm (manifest-entry-version-prefix): New procedure, moved from... (export-manifest)[version-spec]: ... here. Adjust caller. * tests/home-import.scm (version-spec): Remove. (eval-test-with-home-environment): Use 'manifest-entry-version-prefix' instead. * guix/scripts/home/import.scm (import-manifest): Likewise.
2021-10-31home: import: Clarify "destination directory".Ludovic Courtès
Suggested by Liliana Marie Prikler <liliana.prikler@gmail.com>. * guix/scripts/home/import.scm (configurations+modules): Rename 'destination-directory' to 'configuration-directory'. Improve docstring.
2021-10-31home: import: Compare procedures with 'eq?'.Ludovic Courtès
'procedure-name' is a debugging aid and cannot be reliably used to check for procedure equality. * guix/scripts/home/import.scm (configurations+modules): Remove use of 'procedure-name'.
2021-10-31guix home: import: Call ‘local-file’ with ‘name’Xinglu Chen
Set the name of the file to just the basename of the file passed to ‘local-file’. * guix/scripts/home/import.scm (basename+remove-dots): New procedure. (generate-bash-configuration+modules): Use it. * tests/home-import.scm (match-home-environment-bash-service): Adjust accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-31Add tests for ‘guix home import’.Xinglu Chen
* tests/home-import.scm: New file. * Makefile.am (SCM_TESTS): Add it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-31guix home: import: Delete duplicate modules when importing.Xinglu Chen
Two different services might require the same module(s), so delete duplicates when generating the ‘use-modules’ form. * import.scm (manifest->code): Delete duplicate modules. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-31guix home: import: Don’t use 'slurp-file-gexp'.Xinglu Chen
‘slurp-file-gexp’ is not a bound procedure. * guix/scripts/home/import.scm (generate-bash-configuration+modules): Don’t use ‘slurp-file-gexp’. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-31guix home: import: Fix module name for Bash service.Xinglu Chen
* guix/scripts/home/import.scm (generate-bash-configuration+modules): Change (gnu home-services bash) to (gnu home-services shells); add (guix gexp). Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-31guix home: import: Allow multiple modules to be imported for each service.Xinglu Chen
Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multiple modules might need to be imported in order for it to work. * guix/scripts/home/import.scm (generate-bash-module+configuration): Rename to ... (generate-bash-configuration+modules): ... this. (%files-configurations-alist): Rename to ... (%files+configurations-alist): ... this. (modules+configurations): Rename to ... (configurations+modules): ... this. (manifest->code): Adjust accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-31guix home: import: Make the user to specify a destination directory.Xinglu Chen
Copy the appropriate the relevant configuration files to the destination directory, and call ‘local-file’ on them. Without this, ‘guix home import’ will generate a service declaration like this (service home-bash-service-type (home-bash-configuration (bashrc (list (slurp-file-gexp (local-file "/home/yoctocell/.bashrc")))))) but when running ‘guix home reconfigure’, the ~/.bashrc file would be moved, so when running ‘guix home reconfigure’ for the second time, it would read the ~/.bashrc which is itself a symlink to a file the store. * guix/scripts/home/import.scm (generate-bash-module+configuration): Take ‘destination-directory’ parameter (modules+configurations): Copy the user’s configuration file to ‘%destination-directory’. * guix/scripts/home.scm (process-command): Adjust accordingly; create ‘destination’ if it doesn’t exist. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-09home: services: configuration: Support file-like objects.Oleg Pykhalov
* 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-08gnu: Move (gnu home-services) to (gnu home services).Oleg Pykhalov
* gnu/home-services/configuration.scm: Move the content ... * gnu/home/services/configuration.scm: ... here. * doc/guix.texi: Replace (gnu home-services mcron) with (gnu home services mcron). Replace (gnu home-services) with (gnu home services). * gnu/home.scm: Replace (gnu home-services fontutils) with (gnu services fontutils). Replace (gnu home-services shells) with (gnu home services shells). Replace (gnu home-services symlink-manager) with (gnu home services symlink-manager). Replace (gnu home-services xdg) with (gnu home services xdg). * gnu/home-services/fontutils.scm: Rename to gnu/services/fontutils.scm. * gnu/home-services/mcron.scm: Move to gnu/home/services/mcron.scm. Replace (gnu home-services shepherd) with (gnu home services shepherd). * gnu/home-services.scm (%service-type-path): Search home services in "gnu/services". * gnu/home-services/shells.scm: Replace (gnu home-services configuration) with (gnu home services configuration). Rename to gnu/home/services/shells.scm. Replace (gnu home-services utils) with (gnu home services utils). * gnu/home-services/shepherd.scm: Move to gnu/home/services/shepherd.scm. * gnu/home-services/symlink-manager.scm: Rename to gnu/home/services/symlink-manager.scm. * gnu/home-services/utils.scm: Rename to gnu/home/services/utils.scm. * gnu/home-services/xdg.scm: Rename to gnu/home/services/xdg.scm. * guix/scripts/home/import.scm: Replace (gnu home-services bash) with (gnu home services bash). * gnu/home-services.scm: Update documentation string. * doc/he-config-bare-bones.scm: Apply new (gnu home-services ...) modules location. * gnu/local.mk (GNU_SYSTEM_MODULES): Same.
2021-09-28home-services: Add missing imports and function definition.Andrew Tropin
* gnu/home-services/configuration.scm: Add missing imports. * gnu/home-services/utils.scm (list->human-readable-list): Add new function. * gnu/home-services/configuration.scm: Add missing imports. * gnu/home-services/xdg.scm: Fix ensure-list function. * guix/scripts/home/import.scm: Add missing imports. Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
2021-09-09scripts: home: Add import subcommand.Andrew Tropin
* guix/scripts/home/import.scm: New file. * Makefile.am (MODULES): Add it. Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>