diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 1f6a066..2f479a0 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -46,6 +46,10 @@ jobs: run: | nix build '.#q' attic push ${{ secrets.ATTIC_CACHE }} ./result + - name: Build redlib + run: | + nix build '.#redlib' + attic push ${{ secrets.ATTIC_CACHE }} ./result - name: Build rimgo run: | nix build '.#rimgo' diff --git a/.forgejo/workflows/update-flake.yml b/.forgejo/workflows/update-flake.yml index 56f30df..f0886d3 100644 --- a/.forgejo/workflows/update-flake.yml +++ b/.forgejo/workflows/update-flake.yml @@ -21,6 +21,7 @@ jobs: nix-update --flake anonymous-overflow nix-update --flake --version development bulk-downloader-for-reddit nix-update --flake q + nix-update --flake --version main redlib env NIX_PATH=nixpkgs=$(nix flake metadata github:nixos/nixpkgs/nixos-unstable-small --json | jq -r .path) nix-shell ./packages/tabnine/update.sh nix-update --flake vuetorrent - uses: https://github.com/stefanzweifel/git-auto-commit-action@v5 diff --git a/flake.nix b/flake.nix index 9c04922..84784e8 100644 --- a/flake.nix +++ b/flake.nix @@ -43,6 +43,7 @@ lexical = import ./packages/lexical.nix { inherit pkgs lib; }; neovim-nightly = import ./packages/neovim-nightly.nix { inherit (inputs'.neovim-flake.packages) neovim; inherit pkgs lib; }; q = import ./packages/q.nix { inherit pkgs lib; }; + redlib = import ./packages/redlib.nix { inherit pkgs lib; }; rexit = import ./packages/rexit.nix { inherit pkgs lib; }; rimgo = import ./packages/rimgo.nix { inherit pkgs lib; }; vuetorrent = import ./packages/vuetorrent.nix { inherit pkgs lib; }; diff --git a/packages/redlib.nix b/packages/redlib.nix new file mode 100644 index 0000000..007da94 --- /dev/null +++ b/packages/redlib.nix @@ -0,0 +1,31 @@ +{ pkgs, lib }: + +let + inherit (pkgs.stdenv) isDarwin; +in +pkgs.rustPlatform.buildRustPackage rec { + pname = "redlib"; + version = "main"; + + src = pkgs.fetchFromGitHub { + owner = "redlib-org"; + repo = pname; + rev = "7d952f7f18733d23a296afa226be216cbd1f3aea"; + sha256 = "sha256-2AcJoXQOhmIKIkDZzgA8btRwTvgWjlPWc67cRIzRg/4="; + }; + + cargoSha256 = "sha256-MZ3T8fvYYCYn7Pt5YiViabfh/YzKQbOb0CwhY3iP/eg="; + + buildInputs = lib.optionals isDarwin (with pkgs.darwin.apple_sdk.frameworks; [ + Security + ]); + + doCheck = false; + + meta = with lib; { + description = "Private front-end for Reddit"; + homepage = "https://github.com/redlib-org/redlib"; + license = [ licenses.agpl3Only ]; + platforms = [ "x86_64-darwin" "aarch64-darwin" "aarch64-linux" "x86_64-linux" ]; + }; +}