refactor(update-script): Switch from nvfetcher to nix-update
This commit is contained in:
parent
099666d14d
commit
8757f2ad22
8 changed files with 91 additions and 102 deletions
|
@ -1 +1,38 @@
|
|||
{ sources }: sources.crowdsec-hub.src
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
stdenvNoCC,
|
||||
|
||||
writers,
|
||||
nix-update,
|
||||
}:
|
||||
# Using `mkDerivation` so nix-update can pick up the version
|
||||
stdenvNoCC.mkDerivation (drv: {
|
||||
pname = "crowdsec-hub";
|
||||
version = drv.src.rev;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "crowdsecurity";
|
||||
repo = "hub";
|
||||
rev = "fc59f78180f3edfce76df3e77b001c454f567d3d";
|
||||
hash = "sha256-Ejx3ta05SMvV/Dj7wy2iF9QYbGoRvxPB3+QuCIoTX4Q=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
cp -r $src $out
|
||||
'';
|
||||
|
||||
passthru.updateScript =
|
||||
writers.writeNuBin "update-crowdsec-hub"
|
||||
{
|
||||
makeWrapperArgs = [
|
||||
"--prefix"
|
||||
"PATH"
|
||||
":"
|
||||
(lib.makeBinPath [ nix-update ])
|
||||
];
|
||||
}
|
||||
''
|
||||
nix-update --flake --format --version=branch crowdsec-hub
|
||||
'';
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue