Skip to content

Commit

Permalink
Merge pull request #1422 from chitter99/main
Browse files Browse the repository at this point in the history
Allways creating home directory even if nothing in `copyToRoot`
  • Loading branch information
domenkozar authored Sep 9, 2024
2 parents ca84a71 + 894686c commit b92345f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/containers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ let
gid = "1000";
homeDir = "/env";

mkHome = path: (pkgs.runCommand "devenv-container-home" { } ''
mkEnsureHomeExists = pkgs.runCommand "devenv-ensure-home" { } ''
mkdir -p $out${homeDir}
'';

mkHome = path: (pkgs.runCommand "devenv-container-home" { } ''
cp -R ${path}/. $out${homeDir}/
'');

Expand Down Expand Up @@ -91,7 +94,6 @@ let
gname = group;
};


mkDerivation = cfg: nix2container.nix2container.buildImage {
name = cfg.name;
tag = cfg.version;
Expand All @@ -112,6 +114,7 @@ let
})
mkEtc
mkTmp
mkEnsureHomeExists
];

maxLayers = cfg.maxLayers;
Expand Down Expand Up @@ -140,6 +143,7 @@ let
uname = "root";
gname = "root";
}
(mkPerm mkEnsureHomeExists)
];

config = {
Expand Down

0 comments on commit b92345f

Please sign in to comment.