unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: "Daniel Meißner" <daniel.meissner-i4k@ruhr-uni-bochum.de>
To: "Sébastien Rey-Coyrehourcq" <sebastien.rey-coyrehourcq@univ-rouen.fr>
Cc: Julien Lepiller <julien@lepiller.eu>,  help-guix@gnu.org
Subject: Re: Guix home, guix system, channels, some noob questions
Date: Tue, 17 May 2022 12:15:24 +0200	[thread overview]
Message-ID: <87pmkc4g8z.fsf@ruhr-uni-bochum.de> (raw)
In-Reply-To: <aa4501b7-7035-128d-429b-ea09db7780a1@univ-rouen.fr> ("Sébastien Rey-Coyrehourcq"'s message of "Tue, 17 May 2022 11:20:11 +0200")

Sébastien Rey-Coyrehourcq writes:

> If you have some example of guix home profile that use dotfile manager
> i'm interested :)
> I'm planned to use chezmoi with pass (https://www.chezmoi.io/) in go
> that use git to version file.

IIUC you can use Guix home directly and dispense with chezmoi.  However,
I did not know chezmoi before so there might be a use-case that is not
covered by Guix home, in principle though, Guix home is itself a dotfile
manager.  I use it for example to manage my Git config, Emacs config and
others.  The manual has a chapter about it:

https://guix.gnu.org/de/manual/devel/en/html_node/Home-Configuration.html#Home-Configuration

A simple example would be the following:

--8<---------------cut here---------------start------------->8---
(use-modules (gnu home)
             (gnu home services)
             (gnu home services shells)
             (gnu services)
             (gnu packages admin)
             (guix gexp))


(home-environment
 (packages (list htop))
 (services
  (list
   (service home-bash-service-type
            (home-bash-configuration
             (environment-variables
              '(("HISTFILE" . "$XDG_STATE_HOME/bash_history")))))

   (simple-service 'git-config
                   home-files-service-type
                   (list `(".gitconfig"
                           ,(plain-file "gitconfig"
                                        "[user]
	email = daniel.meissner-i4k@ruhr-uni-bochum.de
	name = Daniel Meißner
")))))))
--8<---------------cut here---------------end--------------->8---

This would create a home-environment with the package ‘htop’, a bash
configuration that sets the HISTFILE env var as well as the .gitconfig
file with the above contents.  You can test this environment using:

  guix home container test-home.scm

This spawns a shell where your home environment is set up as specified
but using a container.  So your actual home directory is not modified.
You don’t have to embed all your config files inside the Scheme file
directly.  You can also load from other files, for example, you could
replace the ,(plain-file ...) call with a ,(local-file "gitconfig.txt")
which would use the contents of the file gitconfig.txt which lives next
to your Scheme file for the generation of the .gitconfig file.

Best

--
Daniel


  reply	other threads:[~2022-05-17 10:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11  9:09 Guix home, guix system, channels, some noob questions Sébastien Rey-Coyrehourcq
2022-05-11 10:47 ` Julien Lepiller
2022-05-11 14:36   ` Sébastien Rey-Coyrehourcq
2022-05-11 14:55     ` Sébastien Rey-Coyrehourcq
2022-05-11 15:48       ` Julien Lepiller
2022-05-12  8:40         ` Sébastien Rey-Coyrehourcq
2022-05-12  9:28           ` Julien Lepiller
2022-05-12 12:32             ` Sébastien Rey-Coyrehourcq
2022-05-17  7:26               ` Daniel Meißner
2022-05-17  8:01                 ` Sébastien Rey-Coyrehourcq
2022-05-17  8:57                   ` Daniel Meißner
2022-05-17  9:20                     ` Sébastien Rey-Coyrehourcq
2022-05-17 10:15                       ` Daniel Meißner [this message]
2022-05-17 16:02                         ` Sébastien Rey-Coyrehourcq
2022-05-25 13:34                           ` Daniel Meißner
2022-05-25 18:45                             ` Efraim Flashner
2022-07-11  6:06                             ` Joshua Branson
2022-05-26  0:31                           ` Dominic Martinez
2022-06-01 20:38                             ` Sébastien Rey-Coyrehourcq
2022-06-12 19:32                               ` sebastien rey-coyrehourcq
2022-06-13 19:31                                 ` Dominic Martinez
2022-06-14 10:36                                   ` Sébastien Rey-Coyrehourcq
2022-05-11 21:56       ` Mekeor Melire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmkc4g8z.fsf@ruhr-uni-bochum.de \
    --to=daniel.meissner-i4k@ruhr-uni-bochum.de \
    --cc=help-guix@gnu.org \
    --cc=julien@lepiller.eu \
    --cc=sebastien.rey-coyrehourcq@univ-rouen.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).