home-manager/state: add packages suboption

This commit is contained in:
Gabriel Arazas 2024-08-23 14:38:55 +08:00
parent e2b93fa6df
commit 83277cb09f
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 30 additions and 0 deletions

View File

@ -4,6 +4,7 @@
imports = [
./ports.nix
./paths.nix
./packages.nix
];
options.state = lib.mkOption {

View File

@ -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;
};
}