Commit Graph
100 Commits
Author SHA1 Message Date
Silvan Mosberger 769eac0740 lib/modules: Make sure to not import module _file's into the store
Previously if `_file` was specified by a module:
  trace: warning: The type `types.string' of option `foo' defined in `/nix/store/yxhm2il5yrb92fldgriw0wyqh2kk9qyc-bug.nix' is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.

With this change:
  trace: warning: The type `types.string' of option `foo' defined in `/home/infinisil/src/nixpkgs/bug.nix' is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.
2020-09-29 22:47:58 +02:00
Silvan Mosberger 8908766165 lib/tests: Update for error message changes 2020-09-21 18:24:55 +02:00
Silvan Mosberger 4f0982b223 lib/tests: Allow grepping for newlines in error messages 2020-09-21 18:24:54 +02:00
Silvan Mosberger 910dfdc41e lib/modules: Evaluate single defs for readOnly error
If multiple definitions are passed, this evaluates them all as if they
were the only one, for a better error message. In particular this won't
show module-internal properties like `_type = "override"` and co.
2020-09-21 18:24:52 +02:00
Silvan Mosberger bdfcee2590 lib/modules: Improve error messages using showDefs 2020-09-21 18:24:52 +02:00
Silvan Mosberger 7c20e68f6b lib/options: Introduce showDefs
For pretty-printing definitions, including file and values
2020-09-21 18:24:50 +02:00
Silvan Mosberger 2ff7c3e2e1 lib/types: Remove unreachable if branch
The type's check function already ensured that it can't be passed
non-lists
2020-09-21 17:13:06 +02:00
Silvan Mosberger 366a677dbb Merge pull request #97133 from Infinisil/improved-toPretty
Improve `generators.toPretty`
2020-09-21 17:11:49 +02:00
Silvan Mosberger 15c5ba9d28 lib/generators.toPretty: functors should print as functions
Not attribute sets. So move the function case forward
2020-09-17 18:20:43 +02:00
Silvan Mosberger 05e4d371ef lib/generators.toPretty: Print [] and {} compactly 2020-09-17 18:20:39 +02:00
Silvan Mosberger d0be9e9810 lib/generators.toPretty: Switch away from δ and λ
- These symbols can be confusing for those not familiar with them
- There's no harm in making these more obvious
- Terminals may not print them correctly either

Also changes the function argument printing slightly to be more obvious
2020-09-17 18:20:35 +02:00
Silvan Mosberger 073e9b2aed lib/generators.toPretty: Improved string printing, handling newlines 2020-09-17 18:20:31 +02:00
Silvan Mosberger 47f2eb89c1 lib/generators.toPretty: Implement multiline printing 2020-09-17 18:20:25 +02:00
Silvan Mosberger 4811f54e94 lib/generators.toPretty: Wrap in a go function
As a preparation to the following commit
2020-09-17 18:20:18 +02:00
Silvan Mosberger 0f6231702f lib/generators.toPretty: Only quote attribute names if necessary 2020-09-17 18:20:08 +02:00
Silvan Mosberger 310699319b nixos/doc: Add docs for types.anything 2020-09-15 21:08:19 +02:00
Silvan Mosberger 6a7d250007 lib/tests: Add tests for types.anything 2020-09-15 21:06:05 +02:00
Silvan Mosberger 67551f46fb lib/types: Introduce types.anything
This new type has unsurprising merge behavior: Only attribute sets are
merged together (recursively), and only if they don't conflict.

This is in contrast to the existing types:
- types.attrs is problematic because later definitions completely
  override attributes of earlier definitions, and it doesn't support
  mkIf and co.
- types.unspecified is very similar to types.attrs, but it has smart
  merging behavior that often doesn't make sense, and it doesn't support
  all types
2020-09-15 21:01:07 +02:00
Silvan Mosberger 6e7bc2c6c9 lib/options: Fix mergeEqualOption for singular functions
Previously it would error out for a single function definition
2020-09-15 21:01:07 +02:00
Silvan Mosberger b3810166c7 nixos/doc: Soft deprecate types.attrs 2020-09-15 21:01:04 +02:00
Silvan Mosberger 3558be46b0 Merge pull request #97674 from Avaq/avaq/minecraft-server
minecraft-server: 1.16.2 -> 1.16.3
2020-09-12 18:44:43 +02:00
Silvan Mosberger e0759a4973 Merge pull request #97758 from yorickvP/patch-3
nixos/victoriametrics: escape newlines in ExecStart
2020-09-11 23:11:59 +02:00
Silvan Mosberger c1e96ff74f release*: Support nixpkgsArgs for all release-*.nix files
This is a bit dirty because there's no easy way to propagate these
function arguments while still allowing --arg from the command line
2020-09-11 18:22:01 +02:00
Silvan Mosberger ed5a07c0ef Merge pull request #97114 from Infinisil/type-deprecation
Better type deprecation messages
2020-09-07 19:33:19 +02:00
Silvan Mosberger f73b762aac Merge pull request #97042 from Infinisil/freeform-option-docs
Show sub options of freeform types
2020-09-07 19:31:01 +02:00
Silvan Mosberger a582f6adde lib/types: Set deprecationMessage for types.optionSet 2020-09-07 13:17:19 +02:00
Silvan Mosberger 3b7aca47e0 lib/types: Set deprecationMessage for types.loaOf 2020-09-07 13:17:19 +02:00
Silvan Mosberger 2bed3b2ad7 lib/types: Set deprecationMessage for types.string 2020-09-07 13:17:19 +02:00
Silvan Mosberger 14095f8f48 lib/types: Remove types.list, it's been deprecated long enough
Has been deprecated since fd803fce60
(2013-08-22)
2020-09-07 13:17:18 +02:00
Silvan Mosberger 1d4656225d lib/types: Allow types to emit a deprecation warning
Previously the only way to deprecate a type was using

  theType = lib.warn "deprecated" (mkOptionType ...)

This caused the warning to be emitted when the type was evaluated, but
the error didn't include which option actually used that type.

With this commit, types can specify a deprecationMessage, which when
non-null, is printed along with the option that uses the type
2020-09-07 13:17:14 +02:00
Silvan Mosberger f822080b05 Merge pull request #68887 from teto/ssh_banner
services.openssh: add banner item
2020-09-06 22:15:25 +02:00
Silvan Mosberger 560bb92473 Merge pull request #76794 from dudebout/document-nix-env-multiple-output-install-bug
document nix-env bug relating to multiple output installation
2020-09-05 15:40:26 +02:00
Silvan Mosberger f320dbae41 lib/tests: Add test for freeform option docs 2020-09-04 15:50:13 +02:00
Silvan Mosberger 41c29f2540 Merge pull request #91092 from helsinki-systems/systemd-path-noapply
nixos/systemd: Don't use apply for $PATH
2020-09-04 02:50:12 +02:00
Silvan Mosberger 8272eff97a Merge pull request #96269 from deviant/remove-quilt-series
treewide: convert patch series files to Nix expressions
2020-09-03 23:19:26 +02:00
Silvan Mosberger ea5ba6e13d lib/types: Show sub options of freeform types
Previously if you set the freeform type to e.g. attrsOf (submodule ..),
those submodule options wouldn't be shown in the manual.
2020-09-03 21:16:29 +02:00
Silvan Mosberger 7ff50a7f7b Merge pull request #96564 from K900/murmur-grpc
murmur: support building with grpc
2020-09-03 18:01:32 +02:00
Silvan Mosberger 911497988f Merge pull request #95536 from Infinisil/inputDerivation
mkDerivation: Introduce .inputDerivation for shell.nix build convenience
2020-08-31 15:46:41 +02:00
Silvan Mosberger 6716867eb3 Merge pull request #96686 from nixy/add/tor-package-option
tor: Add option to tor service for package
2020-08-30 23:02:37 +02:00
Silvan Mosberger f9567594d5 Merge pull request #80770 from matthuszagh/netlify-cli
nodePackages: netlify-cli init at 2.59.1
2020-08-27 03:54:27 +02:00
Silvan Mosberger 5494cda394 Merge pull request #85259 from jb55/colorpicker
colorpicker: init at git-2018-01-14
2020-08-24 23:21:02 +02:00
Silvan Mosberger b77d8ead28 Merge pull request #51850 from roberth/nixos-pure
nixos/lib/eval-config.nix: Add extraModules parameter for opt-in purity
2020-08-24 04:29:37 +02:00
Silvan Mosberger 2113ee4fa6 Merge pull request #96017 from baloo/baloo/guile/static-compilation
guile: fixup musl support
2020-08-24 04:08:24 +02:00
Silvan Mosberger 11e9af8b7d Merge pull request #95633 from zowoq/sqlite
sqlite: 3.32.3 -> 3.33.0
2020-08-24 03:52:53 +02:00
Silvan Mosberger b9f9cb313a Merge pull request #85495 from bhougland18/wmutils-libwm
wmutils-libwm: init at 1.0
2020-08-24 03:46:12 +02:00
Silvan Mosberger 03964e52b4 Merge pull request #89546 from andehen/init/snowsql-1.2.5
snowsql: init 1.2.5
2020-08-24 03:42:23 +02:00
Silvan Mosberger dd0c15b341 Merge pull request #95544 from endgame/oldschool-pc-font-bump
ultimate-oldschool-pc-font-pack: 1.0 -> 2.0
2020-08-24 02:43:15 +02:00
Silvan Mosberger ba1088c4cf Merge pull request #78483 from fishi0x01/fishi0x01/creddump
creddump: init at 0.3
2020-08-23 22:10:38 +02:00
Silvan Mosberger 6be340c56e Merge pull request #96061 from danieldk/1password-0.8.1-1
_1password-gui: 0.8.0 -> 0.8.2-1
2020-08-23 21:49:57 +02:00
Silvan Mosberger cf47ba66fb Merge pull request #81129 from scalavision/igv-update-28x
igv: 2.4.19 -> 2.8.0
2020-08-23 19:24:33 +02:00
Silvan Mosberger 4abb13c9b2 Merge pull request #94093 from r-ryantm/auto-update/ibm-sw-tpm2
ibm-sw-tpm2: 1628 -> 1637
2020-08-23 18:50:11 +02:00
Silvan Mosberger a4eb930de3 Merge pull request #96050 from numinit/libguestfs-fixes
libguestfs: Add Berkeley DB as a dependency
2020-08-23 18:35:08 +02:00
Silvan Mosberger 819c43148e Merge pull request #94261 from r-ryantm/auto-update/bazarr
bazarr: 0.8.4.4 -> 0.9
2020-08-23 18:31:50 +02:00
Silvan Mosberger dc2b2bc6b9 Merge pull request #90190 from phunehehe/html5validator
html5validator: init at 0.3.3
2020-08-23 17:18:27 +02:00
Silvan Mosberger adbae906b3 Merge pull request #95861 from RaghavSood/rippled/1.6.0
rippled: 1.5.0 -> 1.6.0
2020-08-23 17:12:08 +02:00
Silvan Mosberger c6fb81d900 Merge pull request #95993 from Avaq/avaq/minecraft-server
minecraft-server: 1.16.1 -> 1.16.2
2020-08-22 20:13:04 +02:00
Silvan Mosberger ecaebb0ec6 Merge pull request #94855 from prusnak/runwayml
runwayml: 0.10.20 -> 0.14.3
2020-08-22 19:12:56 +02:00
Silvan Mosberger f74bdc5c98 Merge pull request #95210 from siriobalmelli-foss/add/replacement
replacement: init at 0.4.4
2020-08-22 18:06:22 +02:00
Silvan Mosberger 3645476e86 Merge pull request #94747 from ptrhlm/kanji-stroke-order-font-4.003
kanji-stroke-order-font: 4.002 -> 4.003
2020-08-22 16:58:53 +02:00
Silvan Mosberger af1ac757ff Merge pull request #95986 from turboMaCk/imwheel-service
nixos/services.imwheel: sleep 3s before restarting
2020-08-22 16:51:48 +02:00
Silvan Mosberger 1fe7fee592 Merge pull request #93347 from symphorien/spacetime
Ocaml spacetime support
2020-08-22 16:38:54 +02:00
Silvan Mosberger f8e6745ad3 Merge pull request #82817 from pacien/smartd-fix-hostname-notifications
smartmontools: fix missing hostname in notifications
2020-08-22 16:09:14 +02:00
Silvan Mosberger 34e4b4ffb5 Merge pull request #94946 from afreakk/sidequest-bump
sidequest: 0.10.2 -> 0.10.11
2020-08-22 16:02:47 +02:00
Silvan Mosberger 51ba2d38e8 Merge pull request #95927 from kuznero/vscode
vscode, vscodium: 1.48.0 -> 1.48.1
2020-08-22 14:11:12 +02:00
Silvan Mosberger 5f212d693f Merge pull request #95938 from Infinisil/fix-manual
nixos/logrotate: Fix option reference
2020-08-22 01:42:23 +02:00
Silvan Mosberger 1b8a94db67 nixos/logrotate: Fix option reference
Fixes the manual build
2020-08-22 01:38:38 +02:00
Silvan Mosberger b6d657adbe release-notes: Mention stricter option evaluation
As caused by https://github.com/NixOS/nixpkgs/pull/82743
2020-08-21 14:37:32 -07:00
Silvan Mosberger d400dcaa48 release-notes: Mention freeform modules
As introduced by https://github.com/NixOS/nixpkgs/pull/82743
2020-08-21 14:37:32 -07:00
Silvan Mosberger bf777413f9 Merge pull request #95722 from Infinisil/dovecot-mailboxes-improved
nixos/dovecot: Improve mailboxes type
2020-08-21 22:40:50 +02:00
Silvan Mosberger 7ff5fd2e91 fzf: Make sure that perl path is valid 2020-08-21 22:30:27 +02:00
Silvan Mosberger 15c8e915f5 Merge pull request #90326 from terlar/fix-tsun
nodePackages.tsun: add typescript dependency
2020-08-20 20:53:18 +02:00
Silvan Mosberger 23962528ce Merge pull request #93703 from taktoa/master
osqp: init at 0.6.0
2020-08-20 02:03:08 +02:00
Silvan Mosberger 5cddce8019 Merge pull request #95804 from eyJhb/androidenv-generatefix
androidenv: fix convert files not quoting urls
2020-08-19 17:47:11 +02:00
Silvan Mosberger f8962fd92e Merge pull request #95446 from Ma27/improve-opt-not-defined-error
lib/modules: improve error-message for undeclared options if prefix contains no options
2020-08-18 18:26:55 +02:00
Silvan Mosberger cfd599e117 Merge pull request #95743 from Ma27/qemu-test-out
nixos/test-instrumentation: properly import `options` for `qemu`-check
2020-08-18 14:29:50 +02:00
Silvan Mosberger fc121e2813 nixos/dovecot: Improve mailboxes type
The previous use of types.either disallowed assigning a list at one
point and an attrset an another.
2020-08-18 14:25:51 +02:00
Silvan Mosberger 7db9fd1dbc Merge pull request #81467 from dawidsowa/rss-bridge
rss-bridge: init at 2020-02-26
2020-08-18 05:00:41 +02:00
Silvan Mosberger d5700d626c lib/modules: Fix nonexistant option error
The refactoring in https://github.com/NixOS/nixpkgs/commit/fd75dc876586bde8cdb683a6952a41132e8db166
introduced a mistake in the error message that doesn't show the full
context anymore. E.g. with this module:

  options.foo.bar = lib.mkOption {
    type = lib.types.submodule {
      baz = 10;
    };
    default = {};
  };

You'd get the error

  The option `baz' defined in `/home/infinisil/src/nixpkgs/config.nix' does not exist.

instead of the previous

  The option `foo.bar.baz' defined in `/home/infinisil/src/nixpkgs/config.nix' does not exist.

This commit undoes this regression
2020-08-18 00:12:36 +02:00
Silvan Mosberger c6aa9e4af6 Merge pull request #95681 from flokli/fontconfig-penultimate-remove
nixos/fonts: remove fontconfig-penultimate
2020-08-17 23:47:52 +02:00
Silvan Mosberger 3e1a40df75 mkDerivation: Introduce .inputDerivation for shell.nix build convenience
This introduces the .inputDerivation attribute on all derivations
created with mkDerivation. This is another derivation that can always
build successfully and whose runtime dependencies are the build time
dependencies of the original derivation.

This allows easy building and distributing of all derivations needed to
enter a nix-shell with

  nix-build shell.nix -A inputDerivation
2020-08-16 00:24:48 +02:00
Silvan MosbergerandRobert Hensing 25d75155f3 nixos/doc: Add freeform modules documentation
Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2020-08-14 22:49:35 +02:00
Silvan Mosberger 42cf8130d7 lib/modules: Add syntactic sugar for config._module.freeformType
This introduces `freeformType` as a top-level module attribute, allowing
definitions like

  {
    freeformType = ...;
    options = ...;
    config = ...;
  }
2020-08-14 22:49:04 +02:00
Silvan Mosberger 3cc42af71f Merge pull request #95400 from kuznero/vscode
vscode, vscodium: 1.47.3 -> 1.48.0
2020-08-14 19:25:27 +02:00
Silvan Mosberger f21c42143b Merge pull request #48740 from midchildan/add-mirakurun
mirakurun: init at 3.3.0
2020-08-11 06:55:56 +02:00
Silvan Mosberger b8e21e1d75 Merge pull request #95038 from r-ryantm/auto-update/dijo
dijo: 0.2.2 -> 0.2.3
2020-08-10 23:38:09 +02:00
Silvan Mosberger e0ded8f4ba lib/modules: Fix freeform modules when there's no definitions 2020-08-10 17:27:33 +02:00
Silvan Mosberger dab35c3025 Merge pull request #94908 from siraben/powder-v95
the-powder-toy: 94.1 -> 95.0
2020-08-08 14:43:02 +02:00
Silvan Mosberger 3735c9ef90 Merge pull request #94713 from fionera/add-qt-video-wlr
qt-video-wlr: init at 2020-08-03
2020-08-08 02:08:31 +02:00
Silvan Mosberger 9a452a6337 Merge pull request #94825 from bachp/qtwebkit-5.212.0-alpha4
qtwebkit: 5.212-alpha-01-26-2018 -> 5.212.0-alpha4
2020-08-08 01:30:20 +02:00
Silvan Mosberger 1c918cf06a Merge pull request #94108 from lopsided98/wxpython-remove-deps
python3Packages.wxPython_4_0: remove unused dependencies
2020-08-07 01:58:43 +02:00
Silvan Mosberger 1436269892 Merge pull request #93179 from Zimmi48/add-get-graphql-schema
nodePackages.get-graphql-schema: init at 2.1.2
2020-08-05 20:48:22 +02:00
Silvan Mosberger d418434d12 Merge pull request #91142 from leungbk/nodePackages-vimls
nodePackages.vim-language-server: init at 2.1.0
2020-08-04 05:11:59 +02:00
Silvan Mosberger 446d80d28d lib/tests: Add tests for freeform modules 2020-08-03 22:37:01 +02:00
Silvan Mosberger 2d45a62899 lib/types: Make submodules use the freeform type description
Submodules that have a freeform type set behave as if that was the type
of the option itself (for values that don't have an option). Since the
submodules options are shown as separate entries in the manual, it makes
sense to show the freeform type as the submodule type.
2020-08-03 22:37:01 +02:00
Silvan Mosberger 65e25deb06 lib/modules: Implement freeform modules
For programs that have a lot of (Nix-representable) configuration options,
a simple way to represent this in a NixOS module is to declare an
option of a type like `attrsOf str`, representing a key-value mapping
which then gets generated into a config file. However with such a type,
there's no way to add type checking for only some key values.

On the other end of the spectrum, one can declare a single separate
option for every key value that the program supports, ending up with a module
with potentially 100s of options. This has the benefit that every value
gets type checked, catching mistakes at evaluation time already. However
the disadvantage is that the module becomes big, becomes coupled to the
program version and takes a lot of effort to write and maintain.

Previously there was a middle ground between these two
extremes: Declare an option of a type like `attrsOf str`, but declare
additional separate options for the values you wish to have type
checked, and assign their values to the `attrsOf str` option. While this
works decently, it has the problem of duplicated options, since now both
the additional options and the `attrsOf str` option can be used to set a
key value. This leads to confusion about what should happen if both are
set, which defaults should apply, and more.

Now with this change, a middle ground becomes available that solves above
problems: The module system now supports setting a freeform type, which
gets used for all definitions that don't have an associated option. This
means that you can now declare all options you wish to have type
checked, while for the rest a freeform type like `attrsOf str` can be
used.
2020-08-03 22:37:00 +02:00
Silvan Mosberger fd75dc8765 lib/modules: Internally collect all unmatched definitions
This fundamentally changes how the module evaluation internally
handles definitions without an associated option.

Previously the values of these definitions were discarded and only
the names were propagated. This was fine because that's all that's
needed for optionally checking whether all definitions have an
associated option with _module.check.

However with the upcoming change of supporting freeform modules,
we *do* need the values of these.

With this change, the module evaluation cleanly separates definitions
that match an option, and ones that do not.
2020-08-03 22:37:00 +02:00
Silvan Mosberger b02a3d7b08 lib/modules: Scope module evaluation variables more tightly
This is a purely cosmetic change so it's easier to see dependencies
between variables.
2020-08-03 22:37:00 +02:00
Silvan Mosberger 396c16113e Merge pull request #91948 from CheariX/joplin-desktop-1.0.224
joplin-desktop: 1.0.216 -> 1.0.233
2020-08-03 22:13:22 +02:00
Silvan Mosberger 64a9b4b7a3 Merge pull request #94165 from siraben/scas
scas: init at 0.4.6
2020-08-01 03:44:21 +02:00
Silvan Mosberger f9c2da7d35 Merge pull request #93232 from ShamrockLee/edukai
edukai: init at 4.0/edusong: init at 1.0/eduli: init at 3.0
2020-08-01 03:39:27 +02:00