Skip to content

packaging: init Nix packaging#161

Open
rlahfa-dinum wants to merge 6 commits intotchapgouv:masterfrom
cloud-gouv:nix
Open

packaging: init Nix packaging#161
rlahfa-dinum wants to merge 6 commits intotchapgouv:masterfrom
cloud-gouv:nix

Conversation

@rlahfa-dinum
Copy link
Copy Markdown

This provides a very simple Flake to run Tchap desktop on any Nix-based system.

This is a source build which means that it can take some time on a modest CPU, it takes 3min to build the Tchap desktop derivation on my EPYC 7763 (128T/64C).

  • aarch64-linux has not been tested but is expected to work.
  • aarch64-darwin has not been tested but is NOT expected to work, help is welcome.

How to test?

Assuming you have flakes:

nix run github:cloud-gouv/tchap-desktop/nix

If you don't have Flakes, you can simply overlay nix/package.nix using your favorite tool of the day: npins, lon, etc.

$ npins add cloud-gouv/tchap-desktop
$ # in an overlay
$ # { tchap-desktop = final.callPackage "${sources.tchap-desktop}/nix/package.nix" { }; }
$ # use pkgs.tchap-desktop in your system

In the future:

  • an auto-update script that automatically bumps all the hashes
  • dropping the redownload of the source tarball to reuse the existing source tarball with filtering
  • CI/CD with NixOS tests

would be great. But let's start with this.

Copy link
Copy Markdown
Author

@rlahfa-dinum rlahfa-dinum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't author this fully myself, we should change the authoring of the commit to include you @jdauphant-dinum.

Comment thread nix/package.nix
install -Dm644 src-tauri/icons/icon.png $out/share/icons/hicolor/128x128/apps/tchap.png

# Créer le fichier .desktop
mkdir -p $out/share/applications
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should make use of makeDesktopItem instead.

Comment thread nix/package.nix
Comment thread nix/package.nix
' \
src-tauri/tauri.conf.json | sponge src-tauri/tauri.conf.json
''
# NOTE: libayatana should use pkg-config…
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should include the upstream issue.

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>

Co-authored-by: Julien Dauphant <julien.dauphant@numerique.gouv.fr>
Comment thread flake.nix Outdated
@@ -0,0 +1,27 @@
{
description = "Tchap desktop";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tchap linux

Comment thread flake.nix Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants