aboutsummaryrefslogtreecommitdiff
path: root/docker.nix
diff options
context:
space:
mode:
Diffstat (limited to 'docker.nix')
-rw-r--r--docker.nix18
1 files changed, 13 insertions, 5 deletions
diff --git a/docker.nix b/docker.nix
index 0cd64856f..8e6aa227f 100644
--- a/docker.nix
+++ b/docker.nix
@@ -4,6 +4,9 @@
, tag ? "latest"
, channelName ? "nixpkgs"
, channelURL ? "https://nixos.org/channels/nixpkgs-unstable"
+, extraPkgs ? []
+, maxLayers ? 100
+, nixConf ? {}
}:
let
defaultPkgs = with pkgs; [
@@ -23,7 +26,7 @@ let
iana-etc
git
openssh
- ];
+ ] ++ extraPkgs;
users = {
@@ -121,12 +124,17 @@ let
(lib.attrValues (lib.mapAttrs groupToGroup groups))
);
- nixConf = {
+ defaultNixConf = {
sandbox = "false";
build-users-group = "nixbld";
- trusted-public-keys = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=";
+ trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
};
- nixConfContents = (lib.concatStringsSep "\n" (lib.mapAttrsFlatten (n: v: "${n} = ${v}") nixConf)) + "\n";
+
+ nixConfContents = (lib.concatStringsSep "\n" (lib.mapAttrsFlatten (n: v:
+ let
+ vStr = if builtins.isList v then lib.concatStringsSep " " v else v;
+ in
+ "${n} = ${vStr}") (defaultNixConf // nixConf))) + "\n";
baseSystem =
let
@@ -229,7 +237,7 @@ let
in
pkgs.dockerTools.buildLayeredImageWithNixDb {
- inherit name tag;
+ inherit name tag maxLayers;
contents = [ baseSystem ];