aboutsummaryrefslogtreecommitdiff
path: root/docker.nix
diff options
context:
space:
mode:
authorAlex Wied <centromere@users.noreply.github.com>2022-07-28 03:36:39 -0400
committerAlex Wied <centromere@users.noreply.github.com>2022-07-28 03:36:39 -0400
commit228028fc1aaad20a217387fbe9d4aa2d8698a048 (patch)
tree0c93c6470c2e51c18eabbd49fe3dd1489123839b /docker.nix
parent280543933507839201547f831280faac614d0514 (diff)
docker.nix: Allow Nix configuration to be customized
Diffstat (limited to 'docker.nix')
-rw-r--r--docker.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/docker.nix b/docker.nix
index ddf6feff5..8e6aa227f 100644
--- a/docker.nix
+++ b/docker.nix
@@ -6,6 +6,7 @@
, channelURL ? "https://nixos.org/channels/nixpkgs-unstable"
, extraPkgs ? []
, maxLayers ? 100
+, nixConf ? {}
}:
let
defaultPkgs = with pkgs; [
@@ -123,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