mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-16 12:19:10 +00:00
34 lines
736 B
Nix
34 lines
736 B
Nix
{ dockerTools, foodogsquaredLib }:
|
|
|
|
{ name, contents ? [ ], pathsToLink ? [ ], enableTypicalSetup ? true, ... }@attrs:
|
|
|
|
dockerTools.buildImage (attrs // {
|
|
name = "fds-${name}";
|
|
|
|
copyToRoot = foodogsquaredLib.buildFDSEnv {
|
|
inherit pathsToLink;
|
|
name = "fds-${name}-root";
|
|
paths =
|
|
contents
|
|
++ lib.optionals enableTypicalSetup (with dockerTools; [
|
|
usrBinEnv
|
|
binSh
|
|
caCertificates
|
|
fakeNss
|
|
]);
|
|
};
|
|
|
|
runAsRoot = ''
|
|
${lib.optionalString enableTypicalSetup ''
|
|
mkdir -p /data
|
|
''}
|
|
${attrs.runAsRoot}
|
|
'';
|
|
|
|
config = attrs.config // lib.optionalAttrs enableTypicalSetup {
|
|
Cmd = [ "/bin/bash" ];
|
|
WorkingDir = "/data";
|
|
Volumes."/data" = { };
|
|
};
|
|
})
|