diff --git a/README.md b/README.md index 077cfbc..8b22aad 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,3 @@ -# nur-packages-template - -**A template for [NUR](https://github.com/nix-community/NUR) repositories** - -## Setup - -1. Click on [Use this template](https://github.com/nix-community/nur-packages-template/generate) to start a repo based on this template. (Do _not_ fork it.) -2. Add your packages to the [pkgs](./pkgs) directory and to - [default.nix](./default.nix) - * Remember to mark the broken packages as `broken = true;` in the `meta` - attribute, or travis (and consequently caching) will fail! - * Library functions, modules and overlays go in the respective directories -3. Choose your CI: Depending on your preference you can use github actions (recommended) or [Travis ci](https://travis-ci.com). - - Github actions: Change your NUR repo name and optionally add a cachix name in [.github/workflows/build.yml](./.github/workflows/build.yml) and change the cron timer - to a random value as described in the file - - Travis ci: Change your NUR repo name and optionally your cachix repo name in - [.travis.yml](./.travis.yml). Than enable travis in your repo. You can add a cron job in the repository settings on travis to keep your cachix cache fresh -5. Change your travis and cachix names on the README template section and delete - the rest -6. [Add yourself to NUR](https://github.com/nix-community/NUR#how-to-add-your-own-repository) - -## README template - -# nur-packages - -**My personal [NUR](https://github.com/nix-community/NUR) repository** - - -![Build and populate cache](https://github.com//nur-packages/workflows/Build%20and%20populate%20cache/badge.svg) - - -[![Cachix Cache](https://img.shields.io/badge/cachix--blue.svg)](https://.cachix.org) +# 个人使用的nur仓库 +主要为个人使用 \ No newline at end of file diff --git a/default.nix b/default.nix index ba2b8ea..3c5e0f8 100644 --- a/default.nix +++ b/default.nix @@ -17,6 +17,7 @@ listen1 = pkgs.callPackage ./pkgs/listen1 { }; idris2 = pkgs.callPackage ./pkgs/idris2 { }; postman = pkgs.callPackage ./pkgs/postman { }; + anytype = pkgs.callPackage ./pkgs/anytype { }; # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; # ... } diff --git a/pkgs/anytype/default.nix b/pkgs/anytype/default.nix new file mode 100644 index 0000000..a165087 --- /dev/null +++ b/pkgs/anytype/default.nix @@ -0,0 +1,40 @@ +{ lib, fetchurl, appimageTools, makeWrapper }: + +let + pname = "anytype"; + version = "0.36.0"; + name = "Anytype-${version}"; + nameExecutable = pname; + src = fetchurl { + url = "https://github.com/anyproto/anytype-ts/releases/download/v${version}/${name}.AppImage"; + name = "Anytype-${version}.AppImage"; + sha256 = "sha256-Efoqy/izULDgd2Dc3ktVZNj9/U0vCtENm0NLr5VKQpQ="; + }; + appimageContents = appimageTools.extractType2 { inherit name src; }; +in +appimageTools.wrapType2 { + inherit name src; + + extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs) + ++ [ pkgs.libsecret ]; + + extraInstallCommands = '' + mv $out/bin/${name} $out/bin/${pname} + source "${makeWrapper}/nix-support/setup-hook" + wrapProgram $out/bin/${pname} \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" + install -m 444 -D ${appimageContents}/anytype.desktop -t $out/share/applications + substituteInPlace $out/share/applications/anytype.desktop \ + --replace 'Exec=AppRun' 'Exec=${pname}' + install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/0x0/apps/anytype.png \ + $out/share/icons/hicolor/512x512/apps/anytype.png + ''; + + meta = with lib; { + description = "P2P note-taking tool"; + homepage = "https://anytype.io/"; + license = licenses.unfree; + # maintainers = with maintainers; [ running-grass ]; + platforms = [ "x86_64-linux" ]; + }; +}