btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / ia / ianny / package.nix
blobf6ccb9db544f8977363e93dfe84a092a5093b39b
1 { lib
2 , fetchFromGitHub
3 , rustPlatform
4 , dbus
5 , pkg-config
6 }:
8 rustPlatform.buildRustPackage rec {
9   pname = "ianny";
10   version = "1.0.0";
12   src = fetchFromGitHub {
13     owner = "zefr0x";
14     repo = "ianny";
15     rev = "v${version}";
16     hash = "sha256-1QkGs4qCzEA4K3H39QcRV+yINIeZRkjBBkASO69F7ik=";
17   };
19   cargoHash = "sha256-gKCmiqHkCB7nP5XIaFi/8Wi/x5WFEHEmHczKiIDDxXE=";
21   nativeBuildInputs = [ pkg-config ];
22   buildInputs = [ dbus.dev ];
24   postPatch = ''
25     substituteInPlace src/main.rs \
26       --replace-fail '/usr/share/locale' $out/share/locale
27   '';
29   preFixup = ''
30     mkdir -p $out/etc/xdg/autostart
31     mkdir -p $out/usr/share/local
32     cp io.github.zefr0x.ianny.desktop $out/etc/xdg/autostart/
33   '';
35   meta = with lib; {
36     description = "Desktop utility that helps preventing repetitive strain injuries by keeping track of usage patterns and periodically informing the user to take breaks";
37     homepage = "https://github.com/zefr0x/ianny";
38     license = licenses.gpl3;
39     mainProgram = "ianny";
40     maintainers = with maintainers; [ max-amb ];
41     platforms = platforms.linux;
42   };