From e7ea2bae4fdb7651028a652fccc3fc43ede0b486 Mon Sep 17 00:00:00 2001 From: Manuel <2084639+tennox@users.noreply.github.com> Date: Sat, 8 Jun 2024 08:30:40 +0200 Subject: [PATCH] [nix-flakes] add ~/.nix-profile/bin to PATH (#51) See https://github.com/nix-community/docker-nixpkgs/issues/50 --- images/nix-flakes/default.nix | 4 ++++ images/nix/default.nix | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/images/nix-flakes/default.nix b/images/nix-flakes/default.nix index 2f0242d..00e9bfa 100644 --- a/images/nix-flakes/default.nix +++ b/images/nix-flakes/default.nix @@ -15,4 +15,8 @@ docker-nixpkgs.nix.override { ''; }) ] ++ extraContents; + + extraEnv = [ + "PATH=/root/.nix-profile/bin:/usr/bin:/bin" # Not sure how to just prepend + ]; } diff --git a/images/nix/default.nix b/images/nix/default.nix index 2f469c4..163212d 100644 --- a/images/nix/default.nix +++ b/images/nix/default.nix @@ -11,6 +11,7 @@ , openssh , xz , extraContents ? [ ] +, extraEnv ? [ ] }: let image = dockerTools.buildImageWithNixDb { @@ -58,7 +59,7 @@ let "PATH=/usr/bin:/bin" "SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt" "USER=root" - ]; + ] ++ extraEnv; }; }; in