Skip to content

Commit

Permalink
akkoma-frontends: use finalAttrs pattern (#352964)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbsds authored Nov 5, 2024
2 parents 3930ea1 + 18331b2 commit 050ccc3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions pkgs/servers/akkoma/admin-fe/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
, python3, pkg-config, libsass
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "admin-fe";
version = "unstable-2024-04-27";

Expand All @@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
};

offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
yarnLock = finalAttrs.src + "/yarn.lock";
hash = "sha256-acF+YuWXlMZMipD5+XJS+K9vVFRz3wB2fZqc3Hd0Bjc=";
};

Expand All @@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
export HOME="$(mktemp -d)"
yarn config --offline set yarn-offline-mirror ${lib.escapeShellArg offlineCache}
yarn config --offline set yarn-offline-mirror ${lib.escapeShellArg finalAttrs.offlineCache}
fixup-yarn-lock yarn.lock
substituteInPlace yarn.lock \
--replace-fail '"git://github.com/adobe-webplatform/eve.git#eef80ed"' '"https://github.com/adobe-webplatform/eve.git#eef80ed"'
Expand Down Expand Up @@ -73,10 +73,10 @@ stdenv.mkDerivation rec {
runHook postInstall
'';

meta = with lib; {
meta = {
description = "Admin interface for Akkoma";
homepage = "https://akkoma.dev/AkkomaGang/akkoma-fe/";
license = licenses.agpl3Only;
maintainers = with maintainers; [ mvs ];
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ mvs ];
};
}
})
18 changes: 9 additions & 9 deletions pkgs/servers/akkoma/akkoma-fe/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
, jpegoptim, oxipng, nodePackages
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "akkoma-fe";
version = "3.11.0";

src = fetchFromGitea {
domain = "akkoma.dev";
owner = "AkkomaGang";
repo = "akkoma-fe";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-Z7psmIyOo8Rvwcip90JgxLhZ5SkkGB94QInEgm8UOjQ=";
};

offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
yarnLock = finalAttrs.src + "/yarn.lock";
hash = "sha256-Uet3zdjLdI4qpiuU4CtW2WwWGcFaOhotLLKfnsAUqho=";
};

Expand All @@ -33,7 +33,7 @@ stdenv.mkDerivation rec {

postPatch = ''
# Build scripts assume to be used within a Git repository checkout
sed -E -i '/^let commitHash =/,/;$/clet commitHash = "${builtins.substring 0 7 src.rev}";' \
sed -E -i '/^let commitHash =/,/;$/clet commitHash = "${builtins.substring 0 7 finalAttrs.src.rev}";' \
build/webpack.prod.conf.js
'';

Expand All @@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
export HOME="$(mktemp -d)"
yarn config --offline set yarn-offline-mirror ${lib.escapeShellArg offlineCache}
yarn config --offline set yarn-offline-mirror ${lib.escapeShellArg finalAttrs.offlineCache}
fixup-yarn-lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
Expand Down Expand Up @@ -73,10 +73,10 @@ stdenv.mkDerivation rec {
runHook postInstall
'';

meta = with lib; {
meta = {
description = "Frontend for Akkoma";
homepage = "https://akkoma.dev/AkkomaGang/akkoma-fe/";
license = licenses.agpl3Only;
maintainers = with maintainers; [ mvs ];
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ mvs ];
};
}
})

0 comments on commit 050ccc3

Please sign in to comment.