Revamp nix packaging
This commit is contained in:
31
default.nix
31
default.nix
@@ -1,22 +1,35 @@
|
||||
{
|
||||
lib
|
||||
, fetchFromGitHub
|
||||
, stdenv
|
||||
, buildPackages
|
||||
, rustPlatform
|
||||
, makeWrapper
|
||||
, mpv
|
||||
, installShellFiles
|
||||
}:
|
||||
|
||||
let
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
in
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "thumbctl";
|
||||
version = "0.1.0";
|
||||
pname = cargoToml.package.name;
|
||||
version = cargoToml.package.version;
|
||||
src = lib.cleanSource ./.;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
|
||||
cargoHash = "";
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
postInstall = let
|
||||
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||||
in ''
|
||||
installShellCompletion --cmd thumbctl \
|
||||
--bash <(${emulator} $out/bin/thumbctl generate-completions --shell bash) \
|
||||
--zsh <(${emulator} $out/bin/thumbctl generate-completions --shell zsh) \
|
||||
--fish <(${emulator} $out/bin/thumbctl generate-completions --shell fish)
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
license = licenses.mit;
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ h7x4 ];
|
||||
platforms = platforms.linux;
|
||||
mainProgram = "thumbctl";
|
||||
|
||||
Reference in New Issue
Block a user