mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-16 06:19:11 +00:00
home-manager/state: add packages suboption
This commit is contained in:
parent
e2b93fa6df
commit
83277cb09f
@ -4,6 +4,7 @@
|
||||
imports = [
|
||||
./ports.nix
|
||||
./paths.nix
|
||||
./packages.nix
|
||||
];
|
||||
|
||||
options.state = lib.mkOption {
|
||||
|
29
modules/home-manager/_private/state/packages.nix
Normal file
29
modules/home-manager/_private/state/packages.nix
Normal 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;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user