1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00

docs: fix README flake commands

The README is corrected to mention using `home-manager switch --flake`
with Nix Flakes.
This commit is contained in:
Nicolas Berbiche 2022-01-20 00:52:49 -05:00 committed by Robert Helgesson
parent c491331718
commit 7eb5106548
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -104,9 +104,10 @@ as follows:
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
# nix-darwin.url = "github:lnl7/nix-darwin";
}; };
outputs = { home-manager, nixpkgs, ... }: { outputs = inputs@{ home-manager, nixpkgs, ... }: {
nixosConfigurations = { nixosConfigurations = {
hostname = nixpkgs.lib.nixosSystem { hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
@ -124,10 +125,31 @@ as follows:
]; ];
}; };
}; };
# You do not need this unless you are using the nix-darwin project
darwinConfigurations = {
hostname = inputs.nix-darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [
./configuration.nix
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jdoe = import ./home.nix;
}
];
};
};
}; };
} }
``` ```
The Home Manager configuration is then part of the NixOS/Darwin configuration
and is automatically rebuilt with the system when using the appropriate command
for the system, such as `nixos-rebuild switch --flake <path>` for NixOS,
and `darwin-rebuild switch --flake <path>` with nix-darwin.
If you are not using NixOS you can place the following flake in If you are not using NixOS you can place the following flake in
`~/.config/nixpkgs/flake.nix` to load your standard Home Manager `~/.config/nixpkgs/flake.nix` to load your standard Home Manager
configuration: configuration:
@ -158,9 +180,8 @@ configuration:
Note, the Home Manager library is exported by the flake under Note, the Home Manager library is exported by the flake under
`lib.hm`. `lib.hm`.
When using flakes, switch to new configurations as you do for the When using flakes, switch to new configurations with
whole system (e. g. `nixos-rebuild switch --flake <path>`) instead of `home-manager switch --flake <path>`.
using the `home-manager` command line tool.
Releases Releases
-------- --------