diff --git a/common.nix b/common.nix index c8cc674..4f63327 100644 --- a/common.nix +++ b/common.nix @@ -68,6 +68,8 @@ with builtins; ungoogled-chromium scc speedtest-rs + + (pkgs.callPackage ./programs/edname.nix {}) ]; }; diff --git a/programs/edname.nix b/programs/edname.nix new file mode 100644 index 0000000..0ba5b21 --- /dev/null +++ b/programs/edname.nix @@ -0,0 +1,45 @@ +{ + stdenv, + coreutils, + findutils, + gnused, + lib, + fetchFromGitea, + makeWrapper, +}: +stdenv.mkDerivation rec { + + pname = "edname"; + version = "1.0.2"; + + nativeBuildInputs = [ makeWrapper ]; + + src = fetchFromGitea { + domain = "git.tudbut.de"; + owner = "TudbuT"; + repo = "edname"; + rev = "v${version}"; + hash = "sha256-8aT/xwdx/ORyCFfOu4LZuxUiErZ9ZiCdhJ/WKAiQwe0="; + }; + + installPhase = '' + mkdir -p $out/bin + cp edname.sh "$out/bin/edname" + wrapProgram "$out/bin/edname" \ + --prefix PATH : "${ + lib.makeBinPath [ + coreutils + findutils + gnused + ] + }" + ''; + + meta = with lib; { + description = "Mass renamer using $EDITOR"; + license = licenses.mit; + maintainers = [ maintainers.tudbut ]; + homepage = "https://git.tudbut.de/TudbuT/edname"; + mainProgram = "edname"; + }; +}