Merge pull request #6902 from centromere/optional-nixpkgs

docker.nix: Provide boolean for whether to bundle nixpkgs
This commit is contained in:
Eelco Dolstra 2022-08-23 14:45:15 +02:00 committed by GitHub
commit b2b607a7a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@
, lib ? pkgs.lib , lib ? pkgs.lib
, name ? "nix" , name ? "nix"
, tag ? "latest" , tag ? "latest"
, bundleNixpkgs ? true
, channelName ? "nixpkgs" , channelName ? "nixpkgs"
, channelURL ? "https://nixos.org/channels/nixpkgs-unstable" , channelURL ? "https://nixos.org/channels/nixpkgs-unstable"
, extraPkgs ? [] , extraPkgs ? []
@ -139,10 +140,12 @@ let
baseSystem = baseSystem =
let let
nixpkgs = pkgs.path; nixpkgs = pkgs.path;
channel = pkgs.runCommand "channel-nixos" { } '' channel = pkgs.runCommand "channel-nixos" { inherit bundleNixpkgs; } ''
mkdir $out mkdir $out
ln -s ${nixpkgs} $out/nixpkgs if [ "$bundleNixpkgs" ]; then
echo "[]" > $out/manifest.nix ln -s ${nixpkgs} $out/nixpkgs
echo "[]" > $out/manifest.nix
fi
''; '';
rootEnv = pkgs.buildPackages.buildEnv { rootEnv = pkgs.buildPackages.buildEnv {
name = "root-profile-env"; name = "root-profile-env";