Logo
Explore Help
Sign In
talexander/nixpkgs
1
0
Fork 0
You've already forked nixpkgs
Code Issues Pull Requests Releases Activity
nixpkgs/lib/tests/modules/declare-bare-submodule-nested-option.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
371 B
Nix
Raw Normal View History

lib.modules: Make option injection work when shorthandOnlyDefinesConfig
2022-02-28 22:57:03 +01:00
{ config, lib, ... }:
lib.modules: Let module declare options directly in bare submodule ... where a bare submodule is an option that has a type like `submoduleWith x`, as opposed to `attrsOf (submoduleWith x)`. This makes migration unnecessary when introducing a freeform type in an existing option tree. Closes #146882
2022-01-24 15:58:17 +01:00
let
inherit (lib) mkOption types;
in
{
options.bare-submodule = mkOption {
type = types.submoduleWith {
lib.modules: Make option injection work when shorthandOnlyDefinesConfig
2022-02-28 22:57:03 +01:00
shorthandOnlyDefinesConfig = config.shorthandOnlyDefinesConfig;
lib.modules: Let module declare options directly in bare submodule ... where a bare submodule is an option that has a type like `submoduleWith x`, as opposed to `attrsOf (submoduleWith x)`. This makes migration unnecessary when introducing a freeform type in an existing option tree. Closes #146882
2022-01-24 15:58:17 +01:00
modules = [
{
options.nested = mkOption {
type = types.int;
default = 1;
};
}
];
};
};
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.1 Page: 2036ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API