Commit graph

130 commits

Author SHA1 Message Date
Maxim Cournoyer
238248aac9
Fix problems initially introduced in commit 543d971ed2, now reinstated.
Commit 543d971ed2 ("services: configuration: Re-order generated record
fields") introduced two regressions, one in guix home and another one in the
zabbix service.

* gnu/home/services/shells.scm (home-bash-extensions): Remove the first
pattern in the match, which used to be to ignore %location.
* gnu/services/monitoring.scm (zabbix-front-end-nginx-extension): Likewise.
2022-11-17 06:49:51 -05:00
Maxim Cournoyer
44554e7133
Revert "services: configuration: Revert to a working ‘guix home’."
This reverts commit 39e4e00f75, with fixes for
the guix home issues reported and another one found while reconfiguring berlin
in the subsequent commit.
2022-11-17 06:49:51 -05:00
Tobias Geerinckx-Rice
39e4e00f75
services: configuration: Revert to a working ‘guix home’.
This reverts commit 543d971ed2, and
its dependent commit 9b21cd2e9a, which
appear to have triggered a recent wave of ‘guix home’ regressions
involving (services (list (service home-bash-service-type))):

In gnu/home/services/shells.scm:
    504:7  3 (home-bash-extensions #<<home-bash-configuration> package: #<package bash@5.1.8 gnu/packages/ba…> …)
In unknown file:
           2 (append #<<location> file: "…" line: 14 column: 12> ())
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure append: Wrong type argument in position 1 (expecting empty list): #<<location> file: "…" line: 14 column: 12>

I should love to dive in & fix this rather than revert, but urgently
need sleep.
2022-11-13 01:00:00 +01:00
Maxim Cournoyer
9b21cd2e9a
services: mcron: Add log? and log-format fields to mcron-configuration.
* gnu/services/mcron.scm (list-of-gexps?): New predicate.
(mcron-configuration): Rewrite using define-configuration.
[log?, log-format]: New fields.
(mcron-shepherd-services): Invoke mcron with the --log and --log-format
arguments when log? is #t,
(generate-doc): New procedure.
* doc/guix.texi (Scheduled Job Execution): Update doc.
(Mcron Home Service): Likewise.
* gnu/home/services/mcron.scm: Keep in sync with the above changes to
gnu/services/mcron.scm.
2022-11-15 16:26:16 -05:00
Andrew Tropin
3ab14386cd
home: dbus: Inherit environment variables from shepherd.
* gnu/home/services/desktop.scm (home-dbus-shepherd-services)[start]
  <#:environment-variables>: Inherit environment variables from shepherd.
2022-10-17 15:49:27 +04:00
Andrew Tropin
6fad3d5985
home: dbus: Remove unecessary list call.
* gnu/home/services/desktop.scm (home-dbus-shepherd-services)[start]
  <#:environment-variables>: Remove unecessary list call.
2022-10-17 15:18:55 +04:00
(
27c4f396b7
home: home-dbus-service-type: Fix make-forkexec-constructor call.
* gnu/home/services/desktop.scm (home-dbus-shepherd-services)[start]
  <#:environment-variables>: Use a quote instead of a gexp.

Signed-off-by: Andrew Tropin <andrew@trop.in>
2022-10-14 11:06:07 +04:00
( via Guix-patches via
4ab434958b
gnu: home: Add home-dbus-service-type.
* gnu/home/services/desktop.scm (home-dbus-service-type): New variable.
(home-dbus-configuration): New record type.
* doc/guix.texi: Document them.

Signed-off-by: Andrew Tropin <andrew@trop.in>
2022-10-13 09:05:46 +04:00
( via Guix-patches via
7030f592c6
home: Add home-batsignal-service-type.
* gnu/home/services/pm.scm (home-batsignal-service-type): New variable.
(home-batsignal-configuration): New record type.
* doc/guix.texi: Document them.
* gnu/local.mk: Add gnu/home/services/pm.scm.
2022-10-04 17:04:45 +04:00
Andrew Tropin
6cdde65bb5
home: shepherd: Add daemonize? option to configuration.
* gnu/home/services/shepherd.scm (home-shepherd-configuration):
Add DAEMONIZE?.
(home-shepherd-configuration-file): Use CONFIG argument instead of two
separate SERVICES and SHEPHERD, respect DAEMONIZE?.
(ensure-shepherd-gexp, launch-shepherd-gexp,
shepherd-xdg-configuration-files): Adjust according to arguments changes in
HOME-SHEPHERD-CONFIGURATION-FILE.
2022-09-14 18:25:11 +03:00
Andrew Tropin
70d58d1556
home: shepherd: Add shepherd/init.scm to XDG_CONFIG_HOME.
* gnu/home/services/shepherd.scm (shepherd-xdg-configuration-files):
New variable.
(home-shepherd-service-type)[extensions]:
Add HOME-XDG-CONFIGURATION-FILES-SERVICE-TYPE extension.
2022-09-12 08:43:08 +03:00
Attila Lendvai
ee08277a70
services: Use the new maybe/unset API.
* gnu/home/services/ssh.scm (serialize-address-family): Use the public API of
the maybe infrastructure.
* gnu/services/file-sharing.scm (serialize-maybe-string): Use maybe-value.
(serialize-maybe-file-object): Use maybe-value-set?.
* gnu/services/getmail.scm (getmail-retriever-configuration): Don't use
internals in unset field declarations.
(getmail-destination-configuration): Ditto.
* gnu/services/messaging.scm (raw-content?): Use maybe-value-set?.
(prosody-configuration): Use %unset-value.
* gnu/services/telephony.scm (jami-shepherd-services): Use maybe-value-set?.
(archive-name->username): Use maybe-value-set?.
* tests/services/configuration.scm ("maybe type, no default"): Use
%unset-value.

Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2022-08-25 00:10:32 -04:00
Andrew Tropin
ffc391500a
home: Use absolute path for home in activation script.
* gnu/home/services.scm (compute-activation-script): Use absolute path for
home in activation script.
2022-08-19 18:55:40 +03:00
Maxim Cournoyer
d9a0ccf13f
home: ssh: Fix invalid value error for address-family.
Fixes <https://issues.guix.gnu.org/57110>, a regression introduced with
a2b89a3319.

* gnu/home/services/ssh.scm (address-family?): Replace *unspecified* with 'unset.
(serialize-address-family): Adjust accordingly.
(openssh-host): Adjust doc.

Reported-by: Oleg Pykhalov <go.wigust@gmail.com>
2022-08-10 09:10:45 -04:00
Andrew Tropin
3b1510b8b9
home: Use warning instead of display.
* gnu/home/services/xdg.scm (compute-on-first-login-script): Use warning
instead of display.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-08-05 15:28:03 +02:00
Andrew Tropin
b57c656f72
home: xdg: Skip mkdir XDG_RUNTIME_DIR in activation script.
* gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation): Skip mkdir
XDG_RUNTIME_DIR in activation script.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-08-05 15:28:02 +02:00
Andrew Tropin
a80edc0d82
home: xdg: Use a single @ instead of @@.
* gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation,
home-xdg-user-directories-files-service): Use single @ intsead of @@.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-08-05 15:28:02 +02:00
Andrew Tropin
9355d46329
home: Add explicit dependency on env to activation script.
* gnu/home/services.scm (compute-activation-script): Add explicit dependency
on env to activation script.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2022-08-02 16:53:29 +08: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
9e4cbb3076
home: services: shell: Do not use "setup" as a verb.
* gnu/home/services/shells.scm (zsh-file-zprofile)
(add-bash-configuration): Do not use "setup" as a word in generated
files.  End sentences with a period.
2022-07-14 01:05:34 +02:00
Ludovic Courtès
7a6302acb0
home: services: Fix typo.
* gnu/home/services.scm (environment-variables->setup-environment-script):
Fix spelling of 'warn-about-duplicate-definitions'.
2022-07-14 01:05:34 +02:00
Reily Siegel
8d922504b2
gnu: home: Add Guix channels service.
* gnu/home/services/guix.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add guix.scm.
* doc/guix.texi: Add documentation for home-channels-service.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-12 01:17:46 +02:00
(
75a520cca6
home: services: shells: Export Fish environment variables.
Variables set in the Fish configuration weren't previously being
exported.

* gnu/home/services/shells.scm (serialize-fish-env-vars): Output the
`set -x` command instead of `set`.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2022-06-29 20:40:36 +02:00
Ludovic Courtès
7f208f68de
home: Add OpenSSH service.
* gnu/home/services/ssh.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* po/guix/POTFILES.in: Add it.
* doc/guix.texi (Secure Shell): New section.
2022-06-17 23:39:32 +02:00
Attila Lendvai
8cb1a49a39
services: configuration: Use *unspecified* instead of 'disabled.
Use *unspecified* as a marker for field values that have not been set.

Rationale: 'disabled may easily clash with user values for boolean fields, is
confusing (i.e. its meaning is *not* boolean false, but unspecified) and it
also passes silently through the symbol? predicate of a field of type symbol.

* gnu/services/configuration.scm (configuration-missing-default-value):
Renamed from configuration-no-default-value.
(define-maybe-helper): Use *unspecified* instead of 'disabled, and make
the default value optional.
* gnu/home/services/desktop.scm (home-redshift-configuration):
Change (maybe-xyz 'disabled) to maybe-xyz.
* gnu/services/authentication.scm (nslcd-configuration): Likewise.
* gnu/services/cgit.scm (repository-cgit-configuration): Likewise.
* gnu/services/file-sharing.scm (serialize-maybe-string)
(serialize-maybe-file-object): Use 'unspecified?' instead of (eq? val
'disabled).
* gnu/services/messaging.scm (raw-content?): Likewise.
(ssl-configuration): Change (maybe-xyz 'disabled) to maybe-xyz.
(prosody-configuration): Likewise.
* gnu/services/file-sharing.scm (transmission-daemon-configuration):
Likewise.
* gnu/services/messaging.scm (define-all-configurations):
Use *unspecified* instead of 'disabled'.
* gnu/services/networking.scm (opendht-configuration): Likewise.
* gnu/services/pm.scm (tlp-configuration): Likewise.
* gnu/services/telephony.scm (jami-account): Likewise.
(jami-configuration): Likewise.
* gnu/services/vpn.scm (openvpn-client-configuration): Likewise.
* tests/services/configuration.scm ("maybe type, no default")
("maybe type, with default"): New tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-06-15 00:25:21 +02:00
Ludovic Courtès
8eb17cebc1
home: services: Add 'lookup-home-service-types' procedure.
* gnu/home/services.scm (lookup-home-service-types): New procedure.
* tests/home-services.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
2022-06-04 12:04:24 +02:00
Bastien Rivière
2c408520f5
home: shells: Migrate fish to xdg-configuration-files.
* gnu/home/services/shells.scm (home-fish-service-type): Use new
xdg-configuration-files-service-type service.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-29 18:07:16 +02:00
Maya
f2eb0d3922
home: services: fish: Fix incorrect ".config" file name.
This is a followup to 5832d9fb60.

* gnu/home/services/shells.scm (fish-files-service): Change "config/"
to ".config/".

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-29 00:33:45 +02:00
Ludovic Courtès
dd2ab92d9d
home: shepherd: Redirect input port to /dev/null.
Suggested by Aleksandr Vityazev <avityazev@posteo.org>.

* gnu/home/services/shepherd.scm (home-shepherd-configuration-file):
Redirect input port to /dev/null.
2022-04-21 00:02:21 +02:00
Ludovic Courtès
bc867b2ab0
home: shepherd: "shepherd.conf" returns one value.
Fixes <https://issues.guix.gnu.org/54779>.
Reported by Aleksandr Vityazev <avityazev@posteo.org>
and Nicolas Graves <ngraves@ngraves.fr>.

* gnu/home/services/shepherd.scm (home-shepherd-configuration-file):
Return one value.
2022-04-21 00:00:14 +02:00
Andrew Tropin
8805c7eab1
home: shepherd: Prevent launching the second instance.
Fixes <https://issues.guix.gnu.org/54545>.

* gnu/home/services/shepherd.scm (launch-shepherd-gexp): Launch shepherd
if and only if its socket file does not already exist.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-12 23:30:09 +02:00
Andrew Tropin
435e1cef00
home: symlink-manager: Handle non-existing directory during cleanup.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Handle
non-existing directory during cleanup.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-11 00:25:33 +02:00
Andrew Tropin
ac8e987ce2
home: shells: Rename zsh related functions.
* gnu/home/services/shells.scm (home-zsh-service-type): Make zsh related
private functions more consistently named.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-11 00:25:32 +02:00
Andrew Tropin
d6b9a3faa8
home: symlink-manager: Use no-follow version of file-exists?.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Use
no-follow version of file-exists?.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-10 00:17:40 +02:00
Andrew Tropin
20645d8467
home: Add home-xdg-data-files-service-type.
* gnu/home/services.scm (home-xdg-data-files-service-type): New variable.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Add a proper
handling for XDG_DATA_HOME value.
* gnu/home/services/xdg.scm (home-xdg-mime-applications-service-type): Use
home-xdg-data-files service.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-08 20:13:48 +02:00
Andrew Tropin
5832d9fb60
home: symlink-manager: Remove appending of leading dot.
* gnu/home/services.scm (xdg-configuration-files-directory): Add leading dot.
* gnu/home/services.scm (xdg-configuration-files-service-type): Change name.
* gnu/home/services/shells.scm (add-shell-profile-file,
zsh-get-configuration-files, add-zsh-dot-configuration,
add-zsh-xdg-configuration, add-bash-configuration): Add leading dots.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Remove
leading dot.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-08 20:13:45 +02:00
Ludovic Courtès
22ab901466
home: shepherd: Default to version 0.9.
* gnu/home/services/shepherd.scm (<home-shepherd-configuration>)[shepherd]:
Default to SHEPHERD-0.9.
(home-shepherd-configuration-file): Use 'start-in-the-background' when
it is defined.
2022-04-07 00:08:56 +02:00
Brian Kubisiak
032f2e261c
home: services: zsh: Fix zshenv creation.
Fixes a regression introduced by
4935501fd9 that would skip generating
the user's ~/.config/zsh/.zshenv unless both of zshenv and
environment-variables are set in the configuration.

* gnu/home/services/shells.scm (zsh-get-configuration-files):
Generate ~/.config/zsh/.zshenv when only one of zshenv or
environment-variables is specified.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-03 12:42:18 +02:00
Andrew Tropin
92c2397070
home: symlink-manager: Respect XDG_CONFIG_HOME during activation.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Respect
XDG_CONFIG_HOME during activation.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-20 19:02:41 +01:00
Andrew Tropin
3c149de461
home: Migrate fountutils and xdg modules to xdg-configuration-files.
* gnu/home/services/fontutils.scm (home-fontconfig-service-type): Migrate to
xdg-configuration-files.
* gnu/home/services/xdg.scm (home-xdg-user-directories-service-type,
home-xdg-mime-applications-service-type): Migrate to xdg-configuration-files.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-20 19:02:41 +01:00
Andrew Tropin
4935501fd9
home: shells: Migrate zsh to xdg-configuration-files.
* gnu/home/services.scm (home-zsh-service-type): Additionally extend
home-xdg-configuration-files-service-type.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-20 19:02:41 +01:00
Andrew Tropin
e0089dc0e9
home: Add home-xdg-configuration-files service.
* gnu/home/services.scm (home-xdg-configuration-files): New variable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-20 19:02:41 +01:00
Andrew Tropin
d3ef61ab17
home: Explicitly connect home-file and symlink-manager services.
* gnu/home/services.scm (home-files-directory): New variable.
* gnu/home/symlink-manager.scm (update-symlinks-script): Use
home-files-directory variable from (gnu home services).

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-20 19:02:41 +01:00
Andrew Tropin
d05954047f
home: symlink-manager: Add missing 'done' word in message.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Add missing
'done' word in message, keep code width below 80 column.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-20 19:02:41 +01:00
Andrew Tropin
9e86e58d6f
home: symlink-manager: Use existing home-directory symbol.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Use
existing home-directory symbol instead of additional getenv call.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-20 19:02:40 +01:00
angryrectangle
3a91c92547
home: services: Fix bash aliases without guix-defaults.
* gnu/home/services/shells.scm: Fix bash aliases not being added if
  guix-defaults? was #f. Also fix inaccuracy in documentation about placement
  of defaults.
* doc/guix.texi (Shells Home Services): Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-18 16:03:34 +01:00
Ludovic Courtès
e607c377bb
home: services: Export record type accessors.
* gnu/home/services/shepherd.scm: Export <home-shepherd-configuration>
accessors.  Re-export <shepherd-service> accessors.
2022-03-18 16:03:33 +01:00
Ludovic Courtès
2a55f99aff
home: symlink-manager: Rename "path" to "file" where appropriate.
* gnu/home/services/symlink-manager.scm (update-symlinks-script):
[home-path]: Rename to...
[home-directory]: ... this.  Adjust users.
[backup-dir]: Rename to...
[backup-directory]: ... this.  Adjust user.
[get-target-path]: Rename to...
[target-file]: ... this.  Adjust users.
[get-backup-path]: Remove.
[backup-file]: Inline it.
[cleanup-symlinks](get-source-path): Rename to...
(source-file): ... this.  Adjust users.
Rename 'he-path' to 'home' and 'new-he-path' to 'pivot'.
2022-03-10 11:43:15 +01:00
Ludovic Courtès
1fb6ef0473
home: symlink-manager: 'create-symlinks' uses 'file-system-fold'.
This removes the need for two intermediate representations of the file
tree.

* gnu/home/services/symlink-manager.scm (update-symlinks-script)
[simplify-file-tree, file-tree-traverse]: Remove.
[create-symlinks]: Rewrite in terms of 'file-system-fold'.
2022-03-10 11:43:14 +01:00
Ludovic Courtès
5fa188e92e
home: symlink-manager: 'cleanup-symlinks' uses 'file-system-fold'.
* gnu/home/services/symlink-manager.scm (update-symlinks-script)[cleanup-symlinks]:
Take a home generation and iterate over its config files directly with
'file-system-fold'.  Adjuster caller accordingly.  Remove 'old-tree'.
2022-03-10 11:43:14 +01:00
Ludovic Courtès
a3a76a8384
home: symlink-manager: Avoid extra 'lstat' call.
* gnu/home/services/symlink-manager.scm (update-symlinks-script)[symlink-to-store?]:
Avoid extra 'lstat' call.
2022-03-10 11:43:14 +01:00
Ludovic Courtès
a81bb1e4bb
home: symlink-manager: Remove 'empty-directory?' and avoid TOCTTOU race.
This removes three 'stat' syscalls.

* gnu/home/services/symlink-manager.scm (update-symlinks-script)[empty-directory?]:
Remove.
[cleanup-symlinks]: Replace use of 'file-exists?', 'file-is-directory?',
and 'empty-directory?' by a single 'rmdir' call.
2022-03-10 11:43:14 +01:00
Ludovic Courtès
e1b38046a6
home: symlink-manager: Use 'file-is-directory?'.
* gnu/home/services/symlink-manager.scm (update-symlinks-script)[directory?]:
Remove.
Change callers to use 'file-is-directory?' instead.
2022-03-10 11:43:13 +01:00
Ludovic Courtès
cf803b71c7
home: symlink-manager: Use 'for-each' when used for effects.
* gnu/home/services/symlink-manager.scm (update-symlinks-script)[cleanup-symlinks]
[create-symlinks]: Use 'for-each' instead of 'map'.
2022-03-10 11:43:13 +01:00
Ludovic Courtès
7a8856f540
home: symlink-manager: Move helper procedures as top-level defines.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Remove
'config-home', which is unused.  Move 'home-path', 'backup-dir',
'get-target-path', 'get-backup-path', 'directory?', 'empty-directory?',
'symlink-to-store?', and 'backup-file' to the top level.  Move
'create-symlinks' and 'cleanup-symlinks' to the top level as well, and
add parameters.  Adjust callers.
2022-03-10 11:43:13 +01:00
Ludovic Courtès
66bf60a4cd
home: symlink-manager: Clarify module imports.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Wrap
body in 'with-imported-modules'.  Move (guix build utils) import to the
top.  Move #$%initialize-gettext after definitions.
2022-03-10 11:43:13 +01:00
Andrew Tropin
60c45fd9fd
home: xdg: Fix xdg-desktop-entry config field serialization.
[[PGP Signed Part:No public key for 2208D20958C1DEB0 created at 2022-03-01T06:09:14+0100 using RSA]]

* gnu/home/services/xdg.scm (serialize-xdg-desktop-entry): Use append instead
of identity to allow multiple alist values.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-01 12:33:07 +01:00
Ludovic Courtès
39e8025d3b
home: Add redshift service.
* gnu/home/services/desktop.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* doc/guix.texi (Desktop Home Services): New node.
2022-02-07 00:05:59 +01:00
Justin Martin
41efa45508
home: services: import i18n module.
Fixes <https://issues.guix.gnu.org/53701>.
Reported by Roland Everaert <r.everaert@protonmail.com>
and Holger Peters <holger.peters@posteo.de>.

* gnu/home/services.scm (%initialize-gettext): remove setlocale for guile scripts.
(compute-on-first-login-script): add module import for i18n.
(compute-on-change-gexp): add module import for i18n.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-02-05 00:59:30 +01:00
Ludovic Courtès
23ccfd3840
home: 'reconfigure' checks for potential downgrades.
* guix/scripts/home.scm (show-help, %options): Add "--allow-downgrades".
(%default-options): Remove 'build-mode'; add 'validate-reconfigure'.
(perform-action): Add #:validate-reconfigure.  Call
'check-forward-update' when ACTION is 'reconfigure.
(process-action): Pass #:validate-reconfigure to 'perform-action'.
* gnu/home/services.scm (home-provenance): Export.
* doc/guix.texi (Invoking guix home): Document '--allow-downgrades'.
2022-01-28 23:14:44 +01:00
Xinglu Chen
cde3376b35
home: services: Make strings in Gexps translateble.
* gnu/home/services.scm (%initialize-gettext): New variable.
(compute-on-first-login-script): Use it.
(compute-on-change-gexp): Likewise.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Likewise.
* po/guix/POTFILES.in: Add gnu/home-services.scm and
gnu/home/services/symlink-manager.scm.

Suggested-by: Ludovic Courtès <ludo@gnu.org>
Link: <https://yhetil.org/guix-bugs/87sfvy8k1u.fsf@gnu.org>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-01-03 19:32:07 +01:00
Tobias Geerinckx-Rice
a4cbd31c5c
home: services: bash: Only source /etc/bashrc if it exists.
* gnu/home/services/shells.scm (home-bash-configuration):
Check whether /etc/bashrc exists before trying to ‘source’ it.

Reported by guixy on #guix.
2021-11-24 19:46:39 +01:00
Vagrant Cascadian
b066c9b03d
gnu: home: services: Fix typo.
* gnu/home/services.scm (compute-on-first-login-script): Fix spelling of
  "appropriate".
2021-11-17 12:55:24 -08:00
Ludovic Courtès
c322d97832
home: services: bash: Emit 'extra-content' first again.
Fixes a regression introduced in
4b96998292 that would less to a
'tests/guix-home.sh' failure.

* gnu/home/services/shells.scm (add-bash-configuration)[file-if-not-empty]:
Move EXTRA-CONTENT first.
2021-11-16 14:38:01 +01:00
Ludovic Courtès
e5d8302b2c
home: services: Fix typo.
Reinstates 4dcec60fa6, minus the
regression it introduced.

* gnu/home/services.scm (compute-on-first-login-script): Use
'program-file', not 'gexp->script'.
2021-11-16 14:37:34 +01:00
Efraim Flashner
b2f8186590
Revert "home-services: Demonadify 'on-first-login' handling."
This commit breaks building guix home
guix home: error: reference to invalid output 'out' of derivation \
    '/gnu/store/86zc4rijsswmfqnaq8rwixcxjl2zyl1c-on-first-login.drv'

This reverts commit 4dcec60fa6.
2021-11-16 15:31:07 +02:00
Vagrant Cascadian
57bf76d832
gnu: home: services: Fix typo.
* gnu/home/services/xdg.scm (home-xdg-base-directories-service-type): Fix
  spelling of "convenient".
2021-11-14 17:37:54 -08:00
Vagrant Cascadian
e149853845
gnu: home: services: Fix typo.
* gnu/home/services/utils.scm: Fix spelling of "anything".
2021-11-14 17:35:30 -08:00
Vagrant Cascadian
6edfcf3e90
gnu: home: services: Fix typo.
* gnu/home/services/shells.scm (home-shell-profile-configuration): Fix
  spelling of "available".
2021-11-14 17:33:35 -08:00
Vagrant Cascadian
40a18f4934
home: services: Typo fix.
* gnu/home/services.scm: Fix spelling of "directory".
2021-11-14 17:32:51 -08:00
Ludovic Courtès
4dcec60fa6
home-services: Demonadify 'on-first-login' handling.
* gnu/home/services.scm (compute-on-first-login-script): Use
'computed-file' instead of' gexp->script'.
(on-first-login-script-entry): Expect a regular value rather than a
monadic value and remove 'mlet'.
2021-11-14 23:18:08 +01:00
Andrew Tropin
5c2f30d3de
home-services: on-first-login: Check if XDG_RUNTIME_DIR exists.
Fixes <https://issues.guix.gnu.org/50945>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

* gnu/home-services.scm (on-first-login): on-first-login won't execute
anything if XDG_RUNTIME_DIR doesn't exists.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-11-14 23:18:08 +01:00
Xinglu Chen
2f665d4309
doc: Improve documentation of the Bash home service
* doc/guix.texi (Shells Home Services): Document ‘home-bash-extension’
  configuration record.
* gnu/home/services/shells.scm (generate-home-bash-documentation): Extract
  docstrings from ‘home-bash-extension’.
  (home-bash-configuration): Expound on docstrings.
  (home-bash-extension): Likewise.

Fixes: <https://issues.guix.gnu.org/50991>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-11-07 23:10:41 +01:00
Xinglu Chen
4b96998292
home: services: bash: Add ‘aliases’ field.
* 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-11-07 23:10:41 +01:00
Oleg Pykhalov
ff20d3928d
home: services: shells: Fix documentation about file-like objects.
* gnu/home/services/shells.scm:
(home-shell-profile-configuration, home-shell-profile-service-type,
home-zsh-configuration, home-zsh-extension, home-bash-configuration,
home-bash-extension, home-fish-configuration, home-fish-extension):
Replace 'strings or gexps' with 'file-like objects' in the documentation.
* doc/guix.texi (Shells Home Services): Same.
2021-10-16 16:48:44 +03: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
0f6a27c2c4
scripts: home: Make sure profile directory exists.
* guix/scripts/home.scm (process-action): Make sure profile directory exists.
2021-10-09 19:24:19 +03:00
Oleg Pykhalov
0e8d2df0f1
Move (gnu home-services) to (gnu home services).
* gnu/home-services.scm (%guix-home-root-directory): Replace
gnu/home-services.scm with "gnu/home/services.scm".
Rename to gnu/home/services.scm.
* gnu/local.mk
(GNU_SYSTEM_MODULES): Rename gnu/home-services.scm to gnu/home/services.scm.
* doc/he-config-bare-bones.scm:
Replace (gnu home-services) with (gnu home services).
* gnu/home.scm: Same.
* gnu/home/services/fontutils.scm: Same.
* gnu/home/services/mcron.scm: Same.
* gnu/home/services/shells.scm: Same.
* gnu/home/services/shepherd.scm: Same.
* gnu/home/services/symlink-manager.scm: Same.
* gnu/home/services/xdg.scm: Same.
* guix/scripts/home.scm: Same.
* guix/self.scm: Same.
2021-10-09 19:24:18 +03:00
Oleg Pykhalov
ba8ddb3480
gnu: Move (gnu home-services) to (gnu home services).
* 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-10-08 15:36:18 +03:00