Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added declarative installation instructions #6208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/manual/installation/nixos.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,31 @@ 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.

Alternatively, home-manager installation can be done declaratively through configuration.nix using the following syntax:
```nix
{ config, pkgs, lib, ... }:

let
home-manager = builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz;
in
{
imports =
[
(import "${home-manager}/nixos")
];

users.users.eve.isNormalUser = true;
home-manager.users.eve = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ];
programs.bash.enable = true;

# The state version is required and should stay at the version you
# originally installed.
home.stateVersion = "24.11";
};
}
```

For example, a NixOS configuration may include the lines

``` nix
Expand Down Expand Up @@ -123,3 +148,4 @@ you create. This contains the system's NixOS configuration.

Once installed you can see [Using Home Manager](#ch-usage) for a more detailed
description of Home Manager and how to use it.

Loading