diff --git a/index.html b/index.html index 449110bb..f3efbc9e 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,6 @@ -
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.
@@ -49,7 +49,7 @@ option. On NixOS you can control this option using the Add the appropriate Home Manager channel. If you are following Nixpkgs master or an unstable channel you can run
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager -$ nix-channel --update
and if you follow a Nixpkgs version 22.11 channel you can run
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager +$ nix-channel --update
and if you follow a Nixpkgs version 23.05 channel you can run
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager $ nix-channel --update
Run the Home Manager installation command and create the first Home Manager generation: @@ -72,7 +72,7 @@ deployed through NixOps.
To make the NixOS module available for use you mu your system configuration. This is most conveniently done by adding a Home Manager channel to the root user. For example, if you are following Nixpkgs master or an unstable channel, you can run
$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager -$ sudo nix-channel --update
and if you follow a Nixpkgs version 22.11 channel, you can run
$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager +$ sudo nix-channel --update
and if you follow a Nixpkgs version 23.05 channel, you can run
$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager $ sudo nix-channel --update
It is then possible to add
imports = [ <home-manager/nixos> ];
to your system configuration.nix
file, which will introduce a new
NixOS option called home-manager.users
whose type is an attribute
set that maps user names to Home Manager configurations.
For example, a NixOS configuration may include the lines
users.users.eve.isNormalUser = true; @@ -102,7 +102,7 @@ tool.To make the NixOS module available for use you must
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager -$ nix-channel --update
and if you follow a Nixpkgs version 22.11 channel, you can run
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager +$ nix-channel --update
and if you follow a Nixpkgs version 23.05 channel, you can run
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager $ nix-channel --update
It is then possible to add
imports = [ <home-manager/nix-darwin> ];
to your nix-darwin configuration.nix
file, which will introduce a
new NixOS option called home-manager
whose type is an attribute set
that maps user names to Home Manager configurations.
For example, a nix-darwin configuration may include the lines
users.users.eve = { @@ -151,7 +151,7 @@ error: A definition for option `programs.emacs.enable' is not of type `boolean'. # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - home.stateVersion = "22.11"; + home.stateVersion = "23.05"; # Let Home Manager install and manage itself. programs.home-manager.enable = true; @@ -177,7 +177,7 @@ error: A definition for option `programs.emacs.enable' is not of type `boolean'. # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - home.stateVersion = "22.11"; + home.stateVersion = "23.05"; # Let Home Manager install and manage itself. programs.home-manager.enable = true; @@ -289,19 +289,15 @@ 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
+writing a Home Manager configuration.
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, if you are using the unstable version of Nixpkgs or NixOS, +then to generate and activate a basic configuration run the command
$ nix run home-manager/master -- init --switch
For Nixpkgs or NixOS version 23.05 run
$ nix run home-manager/release-23.05 -- 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 +This is useful if you want to inspect and edit the configuration before activating it.$ nix run home-manager/$branch -- init $ # Edit files in ~/.config/home-manager -$ nix run home-manager/master -- init --switchAfter the initial activation has completed successfully then building +$ nix run home-manager/$branch -- init --switch
Where $branch
is one of master
or release-23.05
.
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 +For example,$ nix run home-manager/$branch -- init --switch ~/hmconf $ # And after the initial activation. $ home-manager switch --flake ~/hmconfNote
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, @@ -309,60 +305,7 @@ then the command
nix flake lock --update-input <inp such as
--recreate-lock-file
or--update-input <input>
tohome-manager
when building or switching, and these options will be forwarded tonix 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-22.11"; - home-manager = { - url = "github:nix-community/home-manager/release-22.11"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = { nixpkgs, home-manager, ... }: - let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in { - homeConfigurations.jdoe = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - - # Specify your home configuration modules here, for example, - # the path to your home.nix. - modules = [ - ./home.nix - ]; - - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix - }; - }; -}
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
-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
,
-<flake-uri>
may be ~/.config/home-manager
-as a Git tree or path:~/.config/home-manager
if not.
-Since the release 21.05
,
-building a flake-based configuration is as simple as
-
$ home-manager switch --flake '<flake-uri>#jdoe'
once home-manager is installed.
Here, jdoe
is a configuration specified in the flake file,
-and <flake-uri>#jdoe
will be expanded to
-<flake-uri>#homeConfigurations.jdoe.activationPackage
-and be built by Nix.
The flake inputs are not upgraded automatically when switching.
-The analogy to the command home-manager --update ...
is nix flake update
.
If updating more than one input is undesirable,
-the command nix flake lock --update-input <input-name>
can be used.
You can also pass flake-related options
-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 details.
To use Home Manager as a NixOS module,
a bare-minimum flake.nix
would be as follows:
{ description = "NixOS configuration"; diff --git a/options.html b/options.html index 98b2d1bf..ceb12f94 100644 --- a/options.html +++ b/options.html @@ -989,7 +989,7 @@ The state version indicates which default settings are in effect and will therefore help avoid breaking program configurations. Switching to a higher state version typically requires performing some manual steps, such as data -conversion or moving files.Type: one of "18.09", "19.03", "19.09", "20.03", "20.09", "21.03", "21.05", "21.11", "22.05", "22.11", "23.05"
Declared by:
+conversion or moving files. |