diff --git a/index.html b/index.html index 5ef3fd59..080d6ed1 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ -
ca.desrt.dconf
or dconf.service
?ca.desrt.dconf
or dconf.service
?
This manual will eventually describe how to install, use, and extend Home
Manager.
@@ -289,16 +289,36 @@ Prepare your Home Manager configuration (home.nix
).
home.nix
will be evaluated when the flake is built,
so it must be present before bootstrap of Home Manager from the flake.
See Section 2.1, “Configuration Example” for introduction about
-writing a Home Manager configuration.
The installation procedure for the standalone version of Home Manager +is currently different for the unstable and stable branch. +Therefore, if you are tracking the Nixpkgs or NixOS unstable please go to +Section 3.2.1, “Unstable Version”, +and if you track Nixpkgs or NixOS version 22.11 please go to +Section 3.2.2, “Version 22.11”.
To prepare an initial Home Manager configuration for your logged in user,
+you can run the Home Manager init
command directly from its flake.
For example, to generate and activate a basic configuration run the command
$ nix run home-manager/master -- init --switch
This will generate a flake.nix
and a home.nix
file in
+~/.config/home-manager
, creating the directory if it does not exist.
If you omit the --switch
option then the activation will not happen.
+This is useful if you want to inspect and edit the configuration before activating it.
$ nix run home-manager/master -- init +$ # Edit files in ~/.config/home-manager +$ nix run home-manager/master -- init --switch
After the initial activation has completed successfully then building +and activating your flake-based configuration is as simple as
$ home-manager switch
It is possible to override the default configuration directory, if you want. +For example,
$ nix run home-manager/master -- init --switch ~/hmconf +$ # And after the initial activation. +$ home-manager switch --flake ~/hmconf
The flake inputs are not automatically updated by Home Manager.
+You need to use the standard nix flake update
command for that.
If you only want to update a single flake input,
+then the command nix flake lock --update-input <input>
can be used.
You can also pass flake-related options
+such as --recreate-lock-file
or --update-input <input>
+to home-manager
when building or switching,
+and these options will be forwarded to nix build
.
+See the NixOS Wiki page for details.
Set up a flake with a flake.nix
as follows:
{
description = "Home Manager configuration of Jane Doe";
inputs = {
# Specify the source of Home Manager and Nixpkgs.
- nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
home-manager = {
- url = "github:nix-community/home-manager";
+ url = "github:nix-community/home-manager/release-22.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
@@ -322,17 +342,10 @@ Set up a flake with a flake.nix
as follows:
};
};
}
release-22.11
branch,
-change the home-manager
input url to github:nix-community/home-manager/release-22.11
-and nixpkgs
url to github:NixOS/nixpkgs/nixos-22.11
.
-lib.hm
.
-lib.hm
.
+
You can use the above flake.nix
as a template in ~/.config/home-manager
by
-
$ nix flake new ~/.config/home-manager -t github:nix-community/home-manager
+
$ nix flake new ~/.config/home-manager -t github:nix-community/home-manager
Install Home Manager and apply the configuration by
$ nix run <flake-uri>#homeConfigurations.jdoe.activationPackage
Substitute <flake-uri>
with the flake URI of the configuration flake.
If flake.nix
resides in ~/.config/home-manager
,
@@ -349,7 +362,7 @@ the command nix flake lock --update-input <input-na
such as
--recreate-lock-file
or --update-input [input]
to home-manager
when building/switching,
and these options will be forwarded to nix build
.
-See the NixOS Wiki page for detail.
To use Home Manager as a NixOS module, +See the NixOS Wiki page for detail.
To use Home Manager as a NixOS module,
a bare-minimum flake.nix
would be as follows:
{ description = "NixOS configuration"; diff --git a/release-notes.html b/release-notes.html index 6880df16..a9d467e3 100644 --- a/release-notes.html +++ b/release-notes.html @@ -9,7 +9,15 @@ The default configuration location has been changed from then the default flake file location has changed from~/.config/nixpkgs/flake.nix
to~/.config/home-manager/flake.nix
.The old location will continue to work but using it will trigger a warning message. We changed the default configuration location to avoid confusion about -which files belong to Home Manager and which belong to Nixpkgs.
The state version in this release includes the changes below. +which files belong to Home Manager and which belong to Nixpkgs.
home-manager
tool now offers an init
command.
+This command can be used to generate an initial Home Manager configuration,
+and optionally also activate it.
+The recommended installation method for a standalone Home Manager setup
+with Nix flakes uses this new command.
+The standard installation method remains the same but uses the new command internally.
+See Section 3.2.1, “Unstable Version” for more.
+The state version in this release includes the changes below.
These changes are only active if the home.stateVersion
option is set to "23.05" or later.
The options
wayland.windowManager.sway.config.window.titlebar
wayland.windowManager.sway.config.floating.titlebar
-now default to true
which is consistent with the default values
-for those options used by i3
and sway
.
This is the current unstable branch and the information in this section is therefore not final.
This is the current unstable branch and the information in this section is therefore not final.
This release has the following notable changes:
The home.stateVersion
option no longer has a default value.
It used to default to “18.09”, which was the Home Manager version
that introduced the option. If your configuration does not explicitly
diff --git a/tools.html b/tools.html
index 44f81f85..a5791ba1 100644
--- a/tools.html
+++ b/tools.html
@@ -4,6 +4,8 @@
— reconfigure a user environment
home-manager
{
build
|
+ init [--switch] [dir
]
+ |
instantiate
|
edit
@@ -105,6 +107,26 @@
Build configuration into a result
directory.
init
[--switch
] [dir
]
+
+ Generates an initial home.nix
file for the
+ current user. If Nix flakes are enabled, then this command also
+ generates a flake.nix
file.
+
+ If a path dir
is given then the
+ configuration will be generated in that directory. Otherwise, the
+ configuration will be generated in
+ ~/.config/home-manager
. The output directory will
+ be created if it does not exist.
+
+ If the --switch
option is given, then the generated
+ configuration is activated.
+
+ Note, this command will not overwrite any existing files. It is
+ therefore safe to initialize a configuration, edit it, and then re-run
+ the init
command with --switch
+ enabled to activate the configuration.
+
instantiate
Instantiate the configuration and print the resulting derivation.