mkspiffs: fix version number shown in help, cleanup

* Replace git invocation for the project itself with the version number from the derivation
* Replace git invocation for the submodule with 'unknown' (which is what the Makefile falls back to anyway)
* Remove git as a dependency
* Update sha256 -> hash
This commit is contained in:
Stefan Frijters 2024-01-03 13:38:46 +01:00
parent 97f2135e6a
commit 22f78a7499
No known key found for this signature in database
GPG key ID: 7619A6BC6E7DFA6F

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, git }:
{ lib, stdenv, fetchFromGitHub }:
# Changing the variables CPPFLAGS and BUILD_CONFIG_NAME can be done by
# overriding the same-named attributes. See ./presets.nix for examples.
@ -12,11 +12,16 @@ stdenv.mkDerivation rec {
repo = "mkspiffs";
rev = version;
fetchSubmodules = true;
sha256 = "1fgw1jqdlp83gv56mgnxpakky0q6i6f922niis4awvxjind8pbm1";
hash = "sha256-oa6Lmo2yb66IjtEKkZyJBgM/p7rdvmrKfgNd2rAM/Lk=";
};
nativeBuildInputs = [ git ];
buildFlags = [ "dist" ];
makeFlags = [
"VERSION=${version}"
"SPIFFS_VERSION=unknown"
];
installPhase = ''
mkdir -p $out/bin
cp mkspiffs $out/bin