switch formatting to nixpkgs-fmt

This commit is contained in:
Bryton Hall 2023-07-07 22:01:34 -04:00
parent 3598716c73
commit 2712e89716
65 changed files with 4839 additions and 5222 deletions

View file

@ -1,14 +1,9 @@
{
config,
lib,
pkgs,
docker,
...
}:
{ config, lib, pkgs, docker, ... }:
with lib; let
cfg = config.docker;
in {
imports = [./base.nix];
in
{
imports = [ ./base.nix ];
options.docker = {
registry.url = mkOption {
@ -19,11 +14,7 @@ in {
images = mkOption {
description = "Attribute set of docker images that should be published";
type = types.attrsOf (types.submodule ({
name,
config,
...
}: {
type = types.attrsOf (types.submodule ({ name, config, ... }: {
options = {
image = mkOption {
description = "Docker image to publish";
@ -65,13 +56,13 @@ in {
};
};
}));
default = {};
default = { };
};
export = mkOption {
description = "List of images to export";
type = types.listOf types.package;
default = [];
default = [ ];
};
copyScript = mkOption {
@ -86,25 +77,22 @@ in {
config = {
# define docker feature
_m.features = ["docker"];
_m.features = [ "docker" ];
# propagate docker options if docker feature is enabled
_m.propagate = [
{
features = ["docker"];
module = _: {
# propagate registry options
docker.registry = cfg.registry;
};
}
];
_m.propagate = [{
features = [ "docker" ];
module = _: {
# propagate registry options
docker.registry = cfg.registry;
};
}];
# pass docker library as param
_module.args.docker = import ../lib/docker {inherit lib pkgs;};
_module.args.docker = import ../lib/docker { inherit lib pkgs; };
# list of exported docker images
docker.export =
mapAttrsToList (_: i: i.image)
docker.export = mapAttrsToList (_: i: i.image)
(filterAttrs (_: i: i.registry != null) config.docker.images);
};
}