1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-30 18:38:31 +02:00
home-manager/modules
Robert Hensing 26e72d85e6
home-manager: set module class to "homeManager"
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
2024-04-27 09:28:21 +02:00
..
accounts vdirsyncer: add urlCommand and userNameCommand options 2024-03-22 16:56:17 +01:00
config home-cursor: fix typo in XDG data directory link 2023-11-07 09:21:58 +01:00
files home-manager: extract inline shell script to file 2024-04-06 10:04:27 +02:00
i18n/input-method kime: remove documentation dependency on config 2024-03-18 22:13:07 +01:00
launchd treewide: deprecate DRY_RUN_CMD and DRY_RUN_NULL 2024-01-24 13:36:05 +01:00
lib spotify-player: add module 2024-04-19 12:39:30 +02:00
lib-bash home-manager: fix nix-build option -q 2024-03-22 19:46:20 +01:00
misc amberol: add module 2024-04-22 20:06:31 +02:00
po Add translation using Weblate (Icelandic) 2024-04-25 12:04:16 +02:00
programs zsh: use correct autosuggestion color variable (#5320) 2024-04-24 22:59:02 +02:00
services swayosd: add custom style option 2024-04-23 23:09:45 +02:00
targets targets/generic-linux: use xdg path for defexpr 2024-03-09 13:43:12 +01:00
default.nix home-manager: set module class to "homeManager" 2024-04-27 09:28:21 +02:00
files.nix home-manager: extract inline shell script to file 2024-04-06 10:04:27 +02:00
home-environment.nix home-environment: fix formatting 2024-03-28 12:33:23 +01:00
manual.nix docs: add style sheets and scrubDerivations 2024-02-01 01:10:58 +01:00
modules.nix amberol: add module 2024-04-22 20:06:31 +02:00
systemd-activate.rb Revert "systemd: use sd-switch" 2020-08-04 19:38:14 +02:00
systemd-activate.sh home-manager: remove the export of run 2024-01-28 10:53:09 +01:00
systemd.nix systemd: add enable option 2024-04-16 21:12:47 +02:00
xresources.nix treewide: remove now-redundant lib.mdDoc calls 2023-07-17 18:49:09 +01:00
xsession.nix xsession: allow xplugd to restart on failure 2024-01-16 08:07:00 +01:00