Next: , Up: Home Configuration   [Contents][Index]

11.1 Declaring the Home Environment

The home environment is configured by providing home-environment declaration in a file that can be passed to the guix home command (see Invoking guix home). A simple setup can include Bash, SSH and custom text configuration, like in the example below.

Note: It is highly recommended that you manage your shell or shells with Guix Home, because it will make sure that all the necessary scripts are sourced by shell configuration file. Otherwise you will need to do it manually. (see Configuring the Shell).

(use-modules (gnu home)
	     (gnu home-services)
	     (gnu home-services ssh)
	     (gnu home-services shells)
	     (gnu home-services files)
	     (gnu services)
	     (gnu packages admin)
             (guix gexp))

 (home-directory "/home/<USER>")
 ;; (symlink-name ".guix-home-env")
 (packages (list htop))
   (service home-bash-service-type
             (guix-defaults? #t)
             (bash-profile '("\
export HISTFILE=$XDG_CACHE_HOME/.bash_history"))))
   (simple-service 'test-config
                   (list `("config/test.conf"
                           ,(plain-file "tmp-file.txt"
                                        "the content of ~/.config/test.conf"))))
   (service home-ssh-service-type
	       (ssh-host "savannah"
			 '((compression . #f))))))))))

The only required field is home-directory, which says where the profile for this home environment should be placed. The packages field should be self-explanatory, it will install the list of packages into the user’s profile. The most important field is services, it contains a list of home services, which are the basic building blocks of a home environment.

There is no daemon (at least not necessary) related to home service, it’s just an element that is used to declare part of home environment and extend other parts of it. The extension mechanism discussed in the previous chapter (see Defining Services) should not be confused with Shepherd Services. Using this extension mechanism and some Scheme code that glues things together gives a lot of freedom in declaring of very custom home environments.

Next: , Up: Home Configuration   [Contents][Index]