mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
foks: dedup foks, foks-server derivations
should be 0 rebuilds for this commit Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
This commit is contained in:
parent
736aa3bec7
commit
d08b48f9d0
2 changed files with 37 additions and 74 deletions
|
|
@ -1,63 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
foks,
|
||||
pcsclite,
|
||||
pkg-config,
|
||||
stdenv,
|
||||
buildPackages,
|
||||
}:
|
||||
let
|
||||
templFoks = buildPackages.templ.overrideAttrs (old: {
|
||||
pname = "templ-foks";
|
||||
version = "0.3.833";
|
||||
src = old.src.override {
|
||||
hash = "sha256-4K1MpsM3OuamXRYOllDsxxgpMRseFGviC4RJzNA7Cu8=";
|
||||
};
|
||||
vendorHash = "sha256-OPADot7Lkn9IBjFCfbrqs3es3F6QnWNjSOHxONjG4MM=";
|
||||
});
|
||||
in
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "foks-server";
|
||||
version = "0.1.7";
|
||||
foks.overrideAttrs (
|
||||
finalAttrs: prevAttrs: {
|
||||
pname = "${foks.pname}-server";
|
||||
subPackages = [ "server/foks-server" ];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "foks-proj";
|
||||
repo = "go-foks";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-UZ4BZ2/S44hnG+uLHtWR/qqQtr6tbbQbQOgIrN4ciT0=";
|
||||
};
|
||||
postPatch = ''
|
||||
cd ./server/web/templates
|
||||
templ generate
|
||||
cd -
|
||||
'';
|
||||
|
||||
vendorHash = "sha256-+ysHa5KNhoxtoXPgOWC9ZDJKYqF+84s7oyxRib2S6a8=";
|
||||
postInstall = ''
|
||||
ln -s $out/bin/{foks-server,git-remote-foks}
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
cd ./server/web/templates
|
||||
templ generate
|
||||
cd -
|
||||
'';
|
||||
postInstall = ''
|
||||
ln -s $out/bin/{foks-server,git-remote-foks}
|
||||
'';
|
||||
|
||||
subPackages = [ "server/foks-server" ];
|
||||
excludedPackages = [ "server" ];
|
||||
|
||||
buildInputs = lib.optionals (stdenv.hostPlatform.isLinux) [ pcsclite ];
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
templFoks
|
||||
foks
|
||||
];
|
||||
__structuredAttrs = true;
|
||||
|
||||
meta = {
|
||||
description = "Federated key management and distribution system";
|
||||
homepage = "https://foks.pub";
|
||||
downloadPage = "https://github.com/foks-proj/go-foks";
|
||||
changelog = "https://github.com/foks-proj/go-foks/releases/tag/${finalAttrs.src.tag}";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ poptart ];
|
||||
mainProgram = "foks";
|
||||
};
|
||||
})
|
||||
nativeBuildInputs = (prevAttrs.nativeBuildInputs or [ ]) ++ [
|
||||
foks.passthru.templ
|
||||
foks
|
||||
];
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,27 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
|
||||
pcsclite,
|
||||
pkg-config,
|
||||
stdenv,
|
||||
templ,
|
||||
buildPackages,
|
||||
}:
|
||||
let
|
||||
templFoks = buildPackages.templ.overrideAttrs (old: {
|
||||
pname = "templ-foks";
|
||||
version = "0.3.833";
|
||||
src = old.src.override {
|
||||
hash = "sha256-4K1MpsM3OuamXRYOllDsxxgpMRseFGviC4RJzNA7Cu8=";
|
||||
};
|
||||
vendorHash = "sha256-OPADot7Lkn9IBjFCfbrqs3es3F6QnWNjSOHxONjG4MM=";
|
||||
});
|
||||
in
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "foks";
|
||||
version = "0.1.7";
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "foks-proj";
|
||||
repo = "go-foks";
|
||||
|
|
@ -33,12 +25,9 @@ buildGoModule (finalAttrs: {
|
|||
|
||||
postPatch = ''
|
||||
cd ./server/web/templates
|
||||
${templFoks}/bin/templ generate
|
||||
${finalAttrs.passthru.templ}/bin/templ generate
|
||||
cd -
|
||||
'';
|
||||
postInstall = ''
|
||||
ln -s $out/bin/{foks,git-remote-foks}
|
||||
'';
|
||||
|
||||
subPackages = [ "client/foks" ];
|
||||
excludedPackages = [ "server" ];
|
||||
|
|
@ -48,7 +37,20 @@ buildGoModule (finalAttrs: {
|
|||
pkg-config
|
||||
];
|
||||
|
||||
__structuredAttrs = true;
|
||||
postInstall = ''
|
||||
ln -s $out/bin/{foks,git-remote-foks}
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
templ = templ.overrideAttrs (old: {
|
||||
pname = "templ-foks";
|
||||
version = "0.3.833";
|
||||
src = old.src.override {
|
||||
hash = "sha256-4K1MpsM3OuamXRYOllDsxxgpMRseFGviC4RJzNA7Cu8=";
|
||||
};
|
||||
vendorHash = "sha256-OPADot7Lkn9IBjFCfbrqs3es3F6QnWNjSOHxONjG4MM=";
|
||||
});
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Federated key management and distribution system";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue