diff --git a/modules/home-manager/_private/state/default.nix b/modules/home-manager/_private/state/default.nix index 263b829b..2563921f 100644 --- a/modules/home-manager/_private/state/default.nix +++ b/modules/home-manager/_private/state/default.nix @@ -4,6 +4,7 @@ imports = [ ./ports.nix ./paths.nix + ./packages.nix ]; options.state = lib.mkOption { diff --git a/modules/home-manager/_private/state/packages.nix b/modules/home-manager/_private/state/packages.nix new file mode 100644 index 00000000..c0c86ca2 --- /dev/null +++ b/modules/home-manager/_private/state/packages.nix @@ -0,0 +1,29 @@ +{ lib, ... }: + +{ + options.state = + let + packagesSubmodule = { lib, ... }: { + options = { + packages = lib.mkOption { + type = with lib.types; attrsOf package; + default = { }; + description = '' + Source of truth containing a set of packages. Useful for options + where there are no specific options for a package or as a unified + source of truth for different module options requiring a package. + ''; + example = lib.literalExpression '' + { + diff = pkgs.vimdiff; + pager = pkgs.bat; + editor = pkgs.neovim; + } + ''; + }; + }; + }; + in lib.mkOption { + type = lib.types.submodule packagesSubmodule; + }; +}