From a38db89ef85d8e037ed8000cfd1ff54108a3573d Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 21 Feb 2023 00:37:56 +0100 Subject: [PATCH] Add image.fakeRootCommands --- src/nix/modules/service/image.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/nix/modules/service/image.nix b/src/nix/modules/service/image.nix index 7697e36..706a5c1 100644 --- a/src/nix/modules/service/image.nix +++ b/src/nix/modules/service/image.nix @@ -30,6 +30,7 @@ let { name = null; tag = null; contents = null; config = null; created = null; extraCommands = null; maxLayers = null; + fakeRootCommands = null; } args; acceptedArgs = functionArgs dockerTools.streamLayeredImage; @@ -67,6 +68,8 @@ let ln -s $i nix/var/nix/gcroots/docker/$(basename $i) done; ''; + + fakeRootCommands = config.image.fakeRootCommands; }; priorityIsDefault = option: option.highestPrio >= (lib.mkDefault true).priority; @@ -120,6 +123,15 @@ in Top level paths in the container. ''; }; + image.fakeRootCommands = mkOption { + type = types.lines; + default = ""; + description = '' + Commands that build the root of the container in the current working directory. + + See [`dockerTools.buildLayeredImage`](https://nixos.org/manual/nixpkgs/stable/#ssec-pkgs-dockerTools-buildLayeredImage). + ''; + }; image.includeStorePaths = mkOption { type = bool; default = true;