Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeular: init at 3.4.1 #92286

Merged
merged 1 commit into from Aug 21, 2020
Merged

timeular: init at 3.4.1 #92286

merged 1 commit into from Aug 21, 2020

Conversation

ktor
Copy link
Member

@ktor ktor commented Jul 4, 2020

Motivation for this change

I do have the Timeular dice but up until now I've used third party OSS cli software to send my worklogs. Shout out to
Kris Buist, author of https://github.com/krisbuist/timeular-zei-linux, you've enabled the ZEI dice for me on NixOS for two years already!!

I've done all post-editing of timetracks on their Android app that's a little laggy.

Since Timeular has released AppImage version of their desktop app recently I've decided to give it a try. It works flawlessy, is snappy, has nice GUI and connects with the dice without a problem on NixOS. The package could be improved. It doesn't generate .desktop file and could probably use appImageTool instead of appimage-run but it works and user does not need to prepare it's own appimage-run overlay with libsecret.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ktor ktor requested review from tilpner and M-Gregoire July 4, 2020 16:57
@ktor
Copy link
Member Author

ktor commented Jul 4, 2020

Hi @tilpner , @M-Gregoire I've found you both through the pull request: #54696 and figured out you could have good ideas how to package AppImage app better. I've never done that before.

@tilpner
Copy link
Member

tilpner commented Jul 5, 2020

Please do not use appimage-run inside nixpkgs, it is meant exclusively for interactive use.

  • All other packages finish their installation at build-time, with appimage-run the application needs to extract on the first execution
  • This extraction happens for every user, unnecessarily increasing storage requirements
  • There is no garbage collection for the extraction target
  • The extraction target is in writable storage, when it could be extracted into the immutable nix store

You should instead use appimageTools.wrapType2, which also accepts the extraPkgs argument.
The documentation might be helpful, and you can reply here if you encounter any trouble with it.

@ktor
Copy link
Member Author

ktor commented Jul 12, 2020

hi @tilpner, I've applied your advice. Everything runs smoothly! Thank you!

Do you have an idea how could I make wrapType2 function to use/reuse desktop file and icons that are already packaged within the appImage format?

'squashfs-root/timeular.desktop' -> '/nix/store/washyzh5mnwjmw6d3sakpb974jl8c8z4-timeular-3.1.1-extracted/timeular.desktop'
'squashfs-root/usr/share/icons' -> '/nix/store/washyzh5mnwjmw6d3sakpb974jl8c8z4-timeular-3.1.1-extracted/usr/share/icons'
'squashfs-root/usr/share/icons/hicolor' -> '/nix/store/washyzh5mnwjmw6d3sakpb974jl8c8z4-timeular-3.1.1-extracted/usr/share/icons/hicolor'
'squashfs-root/usr/share/icons/hicolor/128x128' -> '/nix/store/washyzh5mnwjmw6d3sakpb974jl8c8z4-timeular-3.1.1-extracted/usr/share/icons/hicolor/128x128'

@tilpner
Copy link
Member

tilpner commented Jul 13, 2020

@ktor That's a recurring problem, and unfortunately appimageTools doesn't account for desktop files. You can follow the workaround used by e.g. the irccloud package:

appimageContents = appimageTools.extractType2 {
inherit name src;
};
in appimageTools.wrapType2 {
inherit name src;
extraPkgs = pkgs: with pkgs; [ at-spi2-core ];
extraInstallCommands = ''
mv $out/bin/${name} $out/bin/${pname}
install -m 444 -D ${appimageContents}/irccloud.desktop $out/share/applications/irccloud.desktop
install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/irccloud.png \
$out/share/icons/hicolor/512x512/apps/irccloud.png
substituteInPlace $out/share/applications/irccloud.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
'';

@ktor
Copy link
Member Author

ktor commented Jul 15, 2020

hi @tilpner,

the package seems to have it all solved: #92799 (icon,desktop file, even automatic import of required extra packages from app image declaration), I'll copy the solution! thx @tfmoraes !!

@tfmoraes
Copy link
Contributor

Thanks @ktor! I used the Joplin-desktop package as base.

@ktor ktor changed the title timeular: init at 3.1.1 timeular: init at 3.3.0 Jul 18, 2020
@ktor
Copy link
Member Author

ktor commented Jul 18, 2020

hi @tilpner @M-Gregoire, package is updated with a desktop file and icon. I've tested the binary to work.

@ktor
Copy link
Member Author

ktor commented Jul 21, 2020

hi @tilpner, I've just realized that irccloud package example you've provided is exactly the same as the one I've found in pull request #92799, thank you! :)

@ktor ktor changed the title timeular: init at 3.3.0 timeular: init at 3.4.0 Aug 4, 2020
@ktor ktor force-pushed the timeular-init branch 2 times, most recently from 02d67b8 to 44479f3 Compare August 4, 2020 08:43
@ktor ktor changed the title timeular: init at 3.4.0 timeular: init at 3.4.1 Aug 18, 2020
@zowoq
Copy link
Contributor

zowoq commented Aug 18, 2020

@ofborg eval

@Lassulus Lassulus merged commit c384897 into NixOS:master Aug 21, 2020
@ktor
Copy link
Member Author

ktor commented Aug 21, 2020

thx @Lassulus!

@ktor ktor deleted the timeular-init branch August 30, 2020 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants