From 2d5b55d23d8ac04744b9ada58cbb75f5d909d201 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 23 Dec 2022 22:40:33 +0100 Subject: [PATCH] home-environment: explicitly use coreutils Before we used dirname and readlink from the ambient environment, which caused problems when they don't behave as expected. Fixes #3516 (cherry picked from commit d7eee202e597bc7789498a8664082cf0ffedaa8f) --- modules/home-environment.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 9d61cc99f..bf83f0d28 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -679,7 +679,6 @@ in gnused ncurses # For `tput`. ] - ++ optional (config.nix.enable && config.nix.package != null) config.nix.package ++ config.home.extraActivationPath ) + ( @@ -688,7 +687,7 @@ in if config.nix.enable && config.nix.package != null then ":${config.nix.package}/bin" else - ":$(dirname $(readlink -m $(type -p nix-env)))" + ":$(${pkgs.coreutils}/bin/dirname $(${pkgs.coreutils}/bin/readlink -m $(type -p nix-env)))" ) + optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";