Commit Graph
311554 Commits
Author SHA1 Message Date
Maximilian Bosch b6d3c9f821 lib/modules: fix error-message when declaring an option inside `config'
The message I originally implemented here was to catch a mixup of
`config' and `options' in a `types.submodule'[1]. However it looks
rather weird for a wrongly declared top-level option.

So I decided to throw

    error: The option `foo' does not exist. Definition values:
           - In `<unknown-file>':
               {
                 bar = {
                   _type = "option";
                   type = {
                     _type = "option-type";
               ...

           It seems as you're trying to declare an option by placing it into `config' rather than `options'!

for an expression like

    with import ./lib;

    evalModules {
      modules = [
        {
          foo.bar = mkOption {
            type = types.str;
          };
        }
      ];
    }

[1]  fa30c9abed
2021-08-25 23:18:27 +02:00
Maximilian Bosch fbc9084c39 lib/options: use depthLimit for toPretty when showing a definition
When having a bogus declaration such as

    { lib, ... }:
    {
      foo.bar = mkOption {
        type = types.str;
      };
    }

the evaluation will terminate with a not-so helpful

    error: stack overflow (possible infinite recursion)

To make sure a useful error is still provided, I added a `depthLimit` of
`10` which should be perfectly sufficient to `toPretty` when it's used
in an error-case for `showDefs`.
2021-08-25 23:18:27 +02:00
Maximilian Bosch 55ea29fd8c lib/generators/toPretty: add evaluation-limit
When having e.g. recursive attr-set, it cannot be printed which is
solved by Nix itself like this:

    $ nix-instantiate --eval -E 'let a.b = 1; a.c = a; in builtins.trace a 1'
    trace: { b = 1; c = <CYCLE>; }
    1

However, `generators.toPretty` tries to evaluate something until it's
done which can result in a spurious `stack-overflow`-error:

    $ nix-instantiate --eval -E 'with import <nixpkgs/lib>; generators.toPretty {  } (mkOption { type = types.str; })'
    error: stack overflow (possible infinite recursion)

Those attr-sets are in fact rather common, one example is shown above, a
`types.<type>`-declaration is such an example. By adding an optional
`depthLimit`-argument, `toPretty` will stop evaluating as soon as the
limit is reached:

    $ nix-instantiate --eval -E 'with import ./Projects/nixpkgs-update-int/lib; generators.toPretty { depthLimit = 2; } (mkOption { type = types.str; })' |xargs -0 echo -e
    "{
      _type = \"option\";
      type = {
        _type = \"option-type\";
        check = <function>;
        deprecationMessage = null;
        description = \"string\";
        emptyValue = { };
        functor = {
          binOp = <unevaluated>;
          name = <unevaluated>;
          payload = <unevaluated>;
          type = <unevaluated>;
          wrapped = <unevaluated>;
        };
        getSubModules = null;
        getSubOptions = <function>;
        merge = <function>;
        name = \"str\";
        nestedTypes = { };
        substSubModules = <function>;
        typeMerge = <function>;
      };
    }"

Optionally, it's also possible to let `toPretty` throw an error if the
limit is exceeded.
2021-08-25 23:18:26 +02:00
Maximilian BoschandGitHub 81f586e8b8 Merge pull request #135624 from paperdigits/dateutils-0.4.9
dateutils: 0.4.8 -> 0.4.9
2021-08-25 22:14:32 +02:00
Robert ScottandGitHub a7f71255b9 Merge pull request #135609 from jbedo/fastp
fastp: 0.20.1 -> 0.22.0
2021-08-25 21:06:44 +01:00
Martin WeineltandJonathan Ringer 304ed7c421 doc/python: explain bulk package set updates 2021-08-25 12:33:10 -07:00
Michele Guerini RoccoandGitHub 296da7b2f8 Merge pull request #133303 from rnhmjoj/cursor
nixos/hidpi: scale X11 core cursor
2021-08-25 21:07:47 +02:00
Jaakko LuttinenandBjørn Forsman 3f2c99d8a1 tvheadend: use ffmpeg_4 instead of ffmpeg_3 2021-08-25 20:20:56 +02:00
Ryan MulliganandGitHub 0930d35fc3 Merge pull request #135361 from r-ryantm/auto-update/step-ca
step-ca: 0.16.0 -> 0.16.2
2021-08-25 11:18:49 -07:00
Silvan MosbergerandGitHub 1ad73dadd2 Merge pull request #132836 from Infinisil/populate-members
nixos/users: Populate group members option
2021-08-25 20:17:09 +02:00
Jonathan RingerandJonathan Ringer 4ffe91a29d qtile: restore derivation name 2021-08-25 10:00:35 -07:00
Robert HensingandGitHub b5f2c5f132 Merge pull request #135670 from NixOS/docker-tools-usr-bin-env
dockerTools.usrBinEnv: add
2021-08-25 18:19:45 +02:00
Graham ChristensenandGitHub 9ea7f443ec Merge pull request #106574 from grahamc/amazon-image-zfs
nixos/amazonImageZfs: init
2021-08-25 12:08:33 -04:00
Martin WeineltandGitHub a90373118d Merge pull request #135492 from mweinelt/octoprint
nixos/octoprint: allow access to serial devices
2021-08-25 18:07:12 +02:00
Ryan MulliganandGitHub ffaf078cdd Merge pull request #135612 from r-ryantm/auto-update/adwaita-qt
adwaita-qt: 1.3.1 -> 1.4.0
2021-08-25 08:36:32 -07:00
Graham Christensen 71b3d18181 amazon images: extend the image-info.json to have a disks object
Having a disks object with a dictionary of all the disks and their
properties makes it easier to process multi-disk images.

Note the rename of `label` to `system_label` is because `$label`i
is something of a special token to jq.
2021-08-25 10:42:35 -04:00
Graham Christensen bd38b059ea NixOS/amazonImageZfs: init
Introduce an AWS EC2 AMI which supports aarch64 and x86_64 with a ZFS
root.

This uses `make-zfs-image` which implies two EBS volumes are needed
inside EC2, one for boot, one for root. It should not matter which
is identified `xvda` and which is `xvdb`, though I have always
uploaded `boot` as `xvda`.
2021-08-25 10:42:35 -04:00
Graham Christensen 076f6e2d94 nixos/make-zfs-image: init
This is a private interface for internal NixOS  use. It is similar
to `make-disk-image` except it is much more opinionated about what
kind of disk image it'll make.

Specifically, it will always create *two* disks:

1. a `boot` disk formatted with FAT in a hybrid GPT mode.
2. a `root` disk which is completely owned by a single zpool.

The partitioning and FAT decisions should make the resulting images
bootable under EFI or BIOS, with systemd-boot or grub.

The root disk's zpools options are highly customizable, including
fully customizable datasets and their options.

Because the boot disk and partition are highly opinionated, it is
expected that the `boot` disk will be mounted at `/boot`. It is
always labeled ESP even on BIOS boot systems.

In order for the datasets to be mounted properly, the `datasets`
passed in to `make-zfs-image` are turned in to NixOS configuration
stored at /etc/nixos/configuration.nix inside the VM.
NOTE: The function accepts a system configuration in the `config`
argument. The *caller* must manually configure the system
in `config` to have each specified `dataset` be represented
by a corresponding `fileSystems` entry.

One way to test the resulting images is with qemu:

```sh
boot=$(find ./result/ -name '*.boot.*');
root=$(find ./result/ -name '*.root.*');

echo '`Ctrl-a h` to get help on the monitor';
echo '`Ctrl-a x` to exit';

qemu-kvm \
    -nographic \
    -cpu max \
    -m 16G \
    -drive file=$boot,snapshot=on,index=0,media=disk \
    -drive file=$root,snapshot=on,index=1,media=disk \
    -boot c \
    -net user \
    -net nic \
    -msg timestamp=on
```
2021-08-25 10:42:35 -04:00
Florian Klink 14b61efa87 dockerTools.usrBinEnv: add
This provides a /usr/bin/env, for shell scripts using the
"/usr/bin/env executable" shebang.
2021-08-25 16:08:39 +02:00
StigandGitHub 6248814b68 Merge pull request #135664 from zakame/contrib/perl-File-lchown-fix-build-on-Darwin
perlPackages.Filelchown: fix build on Darwin
2021-08-25 15:24:49 +02:00
Ryan MulliganandGitHub 7f31e2cbca Merge pull request #135503 from r-ryantm/auto-update/python3.8-google-cloud-access-context-manager
python38Packages.google-cloud-access-context-manager: 0.1.6 -> 0.1.7
2021-08-25 06:17:09 -07:00
Ryan MulliganandGitHub 0551481677 Merge pull request #135552 from r-ryantm/auto-update/quill
quill: 0.2.1 -> 0.2.4
2021-08-25 06:15:53 -07:00
Ryan MulliganandGitHub 47ca52f270 Merge pull request #135636 from r-ryantm/auto-update/kotlin
kotlin: 1.5.21 -> 1.5.30
2021-08-25 06:15:27 -07:00
b35a0c79f5 StarUML: 2.8.1 -> 4.0.1 (#135599)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-08-25 15:14:45 +02:00
SandroandGitHub 80a20c39d1 Merge pull request #130431 from fabaff/bump-pymemcache
python3Packages.pymemcache: 3.4.4 -> 3.5.0
2021-08-25 15:09:31 +02:00
Martin WeineltandGitHub 94b4287560 Merge pull request #135541 from mweinelt/esphome
esphome: 2021.8.0 -> 2021.8.2
2021-08-25 15:09:02 +02:00
SandroandGitHub 3209d79a98 Merge pull request #135632 from fabaff/bump-smbprotocol 2021-08-25 15:01:50 +02:00
R. RyanTMandRaphael Megzari 9c8b5a8b7f headscale: 0.6.1 -> 0.7.0 2021-08-25 21:55:31 +09:00
StigandGitHub fab904ffa4 Merge pull request #135666 from thomasSDK/bump-perlPackages.Graph
perlPackages.Graph: 0.9712 -> 0.9722
2021-08-25 14:39:23 +02:00
Thomas Sean Dominic Kelly d16075b4c5 perlPackages.Graph: 0.9712 -> 0.9722 2021-08-25 13:24:45 +01:00
StigandGitHub 792eb07e54 Merge pull request #135653 from zakame/updates/perl-ExtUtils-CChecker-0.11
perlPackages.ExtUtilsCChecker: 0.10 -> 0.11
2021-08-25 14:20:09 +02:00
Martin Weinelt 7c9d049653 esphome: 2021.8.1 -> 2021.8.2 2021-08-25 14:17:36 +02:00
Zak B. Elep edca4b029f perlPackages.Filelchown: fix build on Darwin 2021-08-25 20:06:04 +08:00
lucasewandRobert Helgesson 83514ae7a9 lib.formats.yaml: use well known YAML format
The way `(lib.formats.yaml {}).generate` generates YAML is compliant
because on YAML 1.2 spec JSON is a subset of YAML but it bugs people's
minds and can lead to problems with software that is not compatible with
YAML 1.2.

This commit also changes the test of the generation function. Data
validation/typing remains the same.

See #133802.

Signed-off-by: lucasew <lucas59356@gmail.com>
2021-08-25 14:02:59 +02:00
SandroandGitHub 346d5ce8a0 Merge pull request #135650 from ianmjones/snippetpixie-1.5.3
snippetpixie: 1.5.2 -> 1.5.3
2021-08-25 14:02:07 +02:00
SandroandGitHub e1e367ca31 Merge pull request #134347 from Stunkymonkey/emacs-elpa-package-phases 2021-08-25 14:01:54 +02:00
SandroandGitHub 0f0bce7c43 Merge pull request #134352 from astro/collectd 2021-08-25 13:57:24 +02:00
SandroandGitHub 8723b6b237 Merge pull request #135567 from r-ryantm/auto-update/python3.8-pex 2021-08-25 13:55:38 +02:00
SandroandGitHub 695ab32a72 Merge pull request #135631 from r-ryantm/auto-update/iotop-c
iotop-c: 1.17 -> 1.18
2021-08-25 13:55:08 +02:00
SandroandGitHub 4ddab9238e Merge pull request #135197 from r-ryantm/auto-update/lsix
lsix: 1.7.4 -> 1.8
2021-08-25 13:54:52 +02:00
SandroandGitHub d79f428ec5 Merge pull request #135639 from r-ryantm/auto-update/kustomize
kustomize: 4.2.0 -> 4.3.0
2021-08-25 13:53:50 +02:00
SandroandGitHub ba2824d029 Merge pull request #135577 from r-ryantm/auto-update/vultr-cli
vultr-cli: 2.7.0 -> 2.8.0
2021-08-25 13:53:14 +02:00
SandroandGitHub 6c3207cd62 Merge pull request #135534 from bzizou/mpldatacursor
python39packages.mpldatacursor: init at 0.7.1
2021-08-25 13:37:31 +02:00
SandroandGitHub 9bd638fee1 Merge pull request #135635 from fabaff/bump-angr 2021-08-25 13:36:26 +02:00
SandroandGitHub a685e22709 Merge pull request #135644 from fabaff/bump-phonenumbers
python3Packages.phonenumbers: 8.12.30 -> 8.12.31
2021-08-25 13:35:34 +02:00
SandroandGitHub 5103e19ce4 Merge pull request #135637 from fabaff/bump-bitarray 2021-08-25 13:35:21 +02:00
SandroandGitHub eb4334e405 Merge pull request #135657 from Ma27/bump-jiq 2021-08-25 13:19:29 +02:00
SandroandGitHub 3382e6d411 Merge pull request #135625 from r-ryantm/auto-update/fioctl 2021-08-25 13:17:41 +02:00
SandroandGitHub abd617e851 Merge pull request #135649 from fabaff/bump-pyrad 2021-08-25 13:16:42 +02:00
SandroandGitHub f9d4579b0e Merge pull request #135435 from SuperSandro2000/google 2021-08-25 13:15:39 +02:00