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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d5e9e5fcf2bd
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 68efd790b840
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 26, 2019

  1. nixos: Don't enable Docker by default

    Regression introduced by c940053.
    
    The commit introduced declarative docker containers and subsequently
    enables docker whenever any declarative docker containers are defined.
    
    This is done via an option with type "attrsOf somesubmodule" and a check
    on whether the attribute set is empty.
    
    Unfortunately, the check was whether a *list* is empty rather than
    wether an attribute set is empty, so "mkIf (cfg != [])" *always*
    evaluates to true and thus subsequently enables docker by default:
    
    $ nix-instantiate --eval nixos --arg configuration {} \
        -A config.virtualisation.docker.enable
    true
    
    Fixing this is simply done by changing the check to "mkIf (cfg != {})".
    
    Tested this by running the "docker-containers" NixOS test and it still
    passes.
    
    Signed-off-by: aszlig <aszlig@nix.build>
    Cc: @benley, @danbst, @infinisil, @nlewo
    aszlig committed Mar 26, 2019
    4

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    grahamc Graham Christensen
    Copy the full SHA
    68efd79 View commit details
Showing with 1 addition and 1 deletion.
  1. +1 −1 nixos/modules/virtualisation/docker-containers.nix
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/docker-containers.nix
Original file line number Diff line number Diff line change
@@ -222,7 +222,7 @@ in {
description = "Docker containers to run as systemd services.";
};

config = mkIf (cfg != []) {
config = mkIf (cfg != {}) {

systemd.services = mapAttrs' (n: v: nameValuePair "docker-${n}" (mkService n v)) cfg;