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: 33443d15e5e8^
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: ccfc2e441559
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Mar 5, 2014

  1. Reuse merge code to merge inner values of container option types

    In particular, this allows use of properties on individual elements of a
    container type. For example, fileSystems."/" = mkMerge [ a b ]; is now
    legal. Also, checking the type of the inner value is now handled by the
    merge code, reducing duplication.
    shlevy committed Mar 5, 2014
    Copy the full SHA
    33443d1 View commit details
    Browse the repository at this point in the history
  2. Add mkMap property to the module system

    This allows specifying configuration that should be merged in with some
    or all elements of a container option (e.g. listOf, attrsOf) without
    needing to know whether those elements are actually defined elsewhere.
    
    For example, this will default the fsType of all filesystems except
    /boot to btrfs (and leaves /boot alone):
    
        fileSystems = mkMap (name: mkIf (name != "/boot") {
          fsType = mkDefault "btrfs";
        });
    
    mkMap takes a function which takes an index of an element and returns a
    value to be merged in with the other definitions for that element. For
    sets, the index is just the attribute name. For lists, the mkMap
    function is passed two arguments: The index of the relevant definition
    in the list of all definitions for that option, and the index of the
    element within that definition.
    shlevy committed Mar 5, 2014
    Copy the full SHA
    48f41cb View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    ccfc2e4 View commit details
    Browse the repository at this point in the history