Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: 14a1907afa06
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: 9bfd864c592a
Choose a head ref
  • 3 commits
  • 1 file changed
  • 2 contributors

Commits on Sep 24, 2018

  1. nixos: top-level: evaluate assertions before warnings

    or else at least the following config will fail with an evaluation error
    instead of an assert
    
    ```
    {
      services.nixosManual.enable = false;
      services.nixosManual.showManual = true;
    }
    ```
    oxij committed Sep 24, 2018
    Copy the full SHA
    fece915 View commit details
    Browse the repository at this point in the history
  2. nixos: top-level: indent

    oxij committed Sep 24, 2018
    Copy the full SHA
    563d5b1 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2018

  1. Merge reording asserts in NixOS eval (#47293)

    Changes the evaluation order in that it evaluates assertions before
    warnings, so that eg. the following would work:
    
      { config, lib, ... }:
    
      {
        options.foo = lib.mkOption {
          type = lib.types.bool;
          default = true;
          description = "...";
        };
    
        options.bar = lib.mkOption {
          type = lib.types.bool;
          default = false;
          description = "...";
        };
    
        config = lib.mkMerge [
          (lib.mkIf config.bar {
            system.build.bar = "foobar";
          })
          (lib.mkIf config.foo {
            assertions = lib.singleton {
              assertion = config.bar;
              message = "Bar needs to be enabled";
            };
            systemd.services.foo = {
              description = "Foo";
              serviceConfig.ExecStart = config.system.build.bar;
            };
          })
        ];
      }
    
    This is because the systemd module includes definitions for warnings
    that would trigger evaluation of the config.system.build.bar definition.
    
    The original pull request references a breakage due to the following:
    
      {
        services.nixosManual.enable = false;
        services.nixosManual.showManual = true;
      }
    
    However, changing the eval order between asserts and warnings clearly is
    a corner case here and it only happens because of the aforementioned
    usage of warnings in the systemd module and needs more discussion.
    
    Nevertheless, this is still useful because it lowers the evaluation time
    whenever an assertion is hit, which is a hard failure anyway.
    aszlig committed Sep 25, 2018
    Copy the full SHA
    9bfd864 View commit details
    Browse the repository at this point in the history