This enables a module system feature documented here:
https://nixos.org/manual/nixpkgs/stable/index.html#module-system-lib-evalModules-param-class
For example, it allows a mistake to be caught, which is loading a
NixOS module into home-manager. This only works when the offending
module declares what it's for with a `_class` attribute.
It is not expected that users declare the `_type`, because the payoff
is small. It is only expected to be set by generic code, such as
functions or libraries that help with the "publishing" of modules
(e.g. flake-parts, flake-utils).
The class feature has been available in the module system since
https://github.com/NixOS/nixpkgs/pull/197547, merged May 6, 2023. It
has been part of all releases since 23.05-beta. The last NixOS release
that did _not_ support it has been end-of-life for close to a year
now.
Example:
(lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [{ _class = "nixos"; imports = [ ./foo.nix ]; }];
}).activation-script
Corresponding error:
error: The module <unknown-file> was imported into homeManager instead of nixos.
(`<unknown-file>` can be improved by also setting `_file`, if known; a
much older feature)
PR #5339
The `home-manager.lib.homeManagerConfiguration` function now has an
additional attribute that can be used to extend a Home Manager
configuration with additional modules outside the project tree.
It works similar to the result of `lib.nixosSystem` from Nixpkgs
This makes it a lot easier to access the `pkgs` that would be used to
build the home configuration, e.g.
nix build ./dotfiles#homeConfigurations."user@host".pkgs.vim
This is useful as it allows access to a Nixpkgs that has been
instiantiated with config and overlays.
This change makes use of the `extend` function inside `lib` to inject
a new `hm` field containing the Home Manager library functions. This
simplifies use of the Home Manager library in the modules and reduces
the risk of accidental infinite recursion.
PR #994
This removes the deprecated use of `xsession.windowManager` as a
string.
This commit also adjusts the xmonad module to become a full module.
I.e., the backwards compatibility hack was removed.
When enabled this module will cause Home Manager to manage the user
environment XDG variables. When disabled, then Home Manager will use
the XDG variables taken from the user environment.
This command allows the user to examine the news items generated by
the news module. See #52.
Many thanks to @nonsequitur and @uvNikita for suggestions and
improvements.
This module is a module to install and configure the home-manager
tool. By managing the home-manager tool through the Home Manager
module system it will be installed/updated on configuration
activation.
This is a module for managing the GNU info directory for the user
profile. See comments at the top of `modules/programs/info.nix` for
further information.
This module generates a `.ssh/config` file. This doesn't embed _all_
options for the ssh client, but the most common ones should be there.
Example usage:
```nix
programs.ssh = {
enable = true;
forwardAgent = true;
controlMaster = "auto";
matchBlocks = [
{
host = "something.blah.edu";
port = 1024;
user = "cleague";
identitiesOnly = true;
}
{
host = "host1 host2 host2.net host2.com";
port = 7422;
hostname = "example.com";
serverAliveInterval = 60;
}
{
host = "lucian";
forwardX11 = true;
forwardX11Trusted = true;
checkHostIP = false;
};
};
};
```
Each entry in `programs.ssh.matchBlocks` must contain a `host` field,
which will be used for the block condition.