about summary refs log tree commit diff
path: root/pkgs/tools/misc/mpremote
diff options
context:
space:
mode:
authorYueh-Shun Li <shamrocklee@posteo.net>2024-03-09 01:04:40 +0800
committerYueh-Shun Li <shamrocklee@posteo.net>2024-03-09 07:53:25 +0800
commit91b3db13093b1aecdba07041eb44b7103c235d94 (patch)
treeee602af3a19fea3d77135eaf8c1818f2ec261706 /pkgs/tools/misc/mpremote
parent89d56ddd5bf9d731f6d723aa4b4f374ecc4b80e4 (diff)
treewide: fix sourceRoot for fetchgit-based src
According to Nixpkgs manual[1] and NixOS 23.11 Release Note[2], the
`sourceRoot` attribute passed to `stdenv.mkDerivation` should be
specified as `"${src.name}"` or `"${src.name}/subdir"` when `src` is
produced using `fetchgit`-based fetchers.

`sourceRoot = "source"` or `sourceRoot = "source/subdir"` is based on
the assumption that the `name` attribute of these pre-unpacked fetchers
are always `"source"`, which is not the case. Expecting constant `name`
also makes the source FODs prone to irrelevent hashes during version
bumps.

[1]: https://nixos.org/manual/nixpkgs/unstable/#var-stdenv-sourceRoot
[2]: https://nixos.org/manual/nixos/stable/release-notes#sec-release-23.11
Diffstat (limited to 'pkgs/tools/misc/mpremote')
-rw-r--r--pkgs/tools/misc/mpremote/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/tools/misc/mpremote/default.nix b/pkgs/tools/misc/mpremote/default.nix
index 892ee9756dbc3..149e3c9686ac3 100644
--- a/pkgs/tools/misc/mpremote/default.nix
+++ b/pkgs/tools/misc/mpremote/default.nix
@@ -17,7 +17,7 @@ buildPythonApplication rec {
     rev = "refs/tags/v${version}";
     hash = "sha256-67CAR34VrMOzvNkukDeGRnUfoOLO66R37wsrRHjpp5E=";
   };
-  sourceRoot = "source/tools/mpremote";
+  sourceRoot = "${src.name}/tools/mpremote";
   format = "pyproject";
 
   nativeBuildInputs = [