/ flake.nix
flake.nix
 1  {
 2    description = "bwSyncShare Client";
 3  
 4    inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; };
 5  
 6    outputs = { self, nixpkgs }:
 7      let
 8        system = "x86_64-linux";
 9        pkgs = nixpkgs.legacyPackages.${system};
10      in {
11        packages.${system}.default = let
12  
13          pname = "bwSyncShare-client";
14          version = "3.17.2";
15  
16          src = pkgs.fetchurl {
17            url =
18              "https://customerupdates.nextcloud.com/kk1eoZCTo0kI5HpGE3IT/bwSyncShare-Linux64-3.17.2-build-33889.AppImage";
19            hash = "sha256-5PPcbW+9pM9aOVxbY+l8IxTelp709oT/mfr5h9lSrd4=";
20          };
21  
22          appimageContents =
23            pkgs.appimageTools.extract { inherit pname version src; };
24  
25        in pkgs.appimageTools.wrapType2 {
26          inherit pname version src;
27  
28          extraInstallCommands = ''
29            mv $out/bin/${pname} $out/bin/bwsyncshare
30            install -m 444 -D ${appimageContents}/edu.kit.bwsyncandshare.bwsyncshare.desktop \
31              $out/share/applications/bwsyncshare.desktop
32            install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/Nextcloud.png \
33              $out/share/icons/hicolor/512x512/apps/bwsyncshare.png
34            substituteInPlace $out/share/applications/bwsyncshare.desktop \
35              --replace-fail Nextcloud bwsyncshare
36          '';
37        };
38      };
39  }