1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 03:47:13 -04:00
nixpkgs/pkgs/servers/fedigroups/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

56 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchFromGitea
, rustPlatform
, pkg-config
, git
, openssl
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "fedigroups";
version = "0.4.5";
src = fetchFromGitea {
domain = "git.ondrovo.com";
owner = "MightyPork";
repo = "group-actor";
rev = "v${version}";
hash = "sha256-NMqoYUNN2ntye9mNC3KAAc0DBg+QY7+6/DASwHPexY0=";
forceFetchGit = true; # Archive generation is disabled on this gitea instance
leaveDotGit = true; # git command in build.rs
};
# The lockfile in the repo is not up to date
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"elefren-0.22.0" = "sha256-zCmopdkBHT0gzNGQqZzsnIyMyAt0XBbQdOCpegF6TsY=";
};
};
nativeBuildInputs = [
pkg-config
git
];
buildInputs = [
openssl
] ++ lib.optional stdenv.hostPlatform.isDarwin Security;
meta = with lib; {
homepage = "https://git.ondrovo.com/MightyPork/group-actor#fedi-groups";
downloadPage = "https://git.ondrovo.com/MightyPork/group-actor/releases";
description = "Approximation of groups usable with Fediverse software that implements the Mastodon client API";
license = licenses.mit;
maintainers = with maintainers; [ fgaz ];
platforms = platforms.all;
mainProgram = "fedigroups";
};
}