diff options
author | John Axel Eriksson <john@insane.se> | 2021-12-16 11:29:05 +0100 |
---|---|---|
committer | John Axel Eriksson <john@insane.se> | 2021-12-16 11:29:05 +0100 |
commit | 6942ee8a84f695332149f9a14046b51f2cb6462c (patch) | |
tree | 6f3d6af3d27aa8aa453e8f43f3cd7230269b04a5 | |
parent | 59a5f358024781d81655e3787135f6b24e9b9bdb (diff) |
docker: fix image so that nix profile works
nix profile will otherwise throw this error:
error: path '/nix/var/nix/profiles/default/manifest.nix' is not in the Nix store
That's not entirely true since manifest.nix is within a directory in
the nix store but nix profile seems to require the manifest.nix itself
to be a store path.
-rw-r--r-- | docker.nix | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/docker.nix b/docker.nix index 2a13c23fb..ffb553f78 100644 --- a/docker.nix +++ b/docker.nix @@ -137,11 +137,8 @@ let name = "root-profile-env"; paths = defaultPkgs; }; - profile = pkgs.buildPackages.runCommand "user-environment" { } '' - mkdir $out - cp -a ${rootEnv}/* $out/ - - cat > $out/manifest.nix <<EOF + manifest = pkgs.buildPackages.runCommand "manifest.nix" { } '' + cat > $out <<EOF [ ${lib.concatStringsSep "\n" (builtins.map (drv: let outputs = drv.outputsToInstall or [ "out" ]; @@ -161,6 +158,11 @@ let ] EOF ''; + profile = pkgs.buildPackages.runCommand "user-environment" { } '' + mkdir $out + cp -a ${rootEnv}/* $out/ + ln -s ${manifest} $out/manifest.nix + ''; in pkgs.runCommand "base-system" { |