storj: create package

This commit is contained in:
Jake Hillion 2023-06-11 15:15:49 +01:00
parent b1a0071c40
commit 730a95369a
2 changed files with 40 additions and 2 deletions

View File

@ -21,6 +21,11 @@
let
fqdns = builtins.attrNames (builtins.readDir ./hosts);
isNixos = fqdn: !builtins.pathExists ./hosts/${fqdn}/darwin;
getSystemOverlays = system: nixpkgsConfig: [
(final: prev: {
"storj" = final.callPackage ./pkgs/storj.nix { };
})
];
mkHost = fqdn:
let system = builtins.readFile ./hosts/${fqdn}/system;
in
@ -32,9 +37,10 @@
./modules/default.nix
agenix.nixosModules.default
home-manager.nixosModules.default
{
({ config, ... }: {
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
}
nixpkgs.overlays = getSystemOverlays config.nixpkgs.hostPlatform.system config.nixpkgs.config;
})
];
};
in

32
pkgs/storj.nix Normal file
View File

@ -0,0 +1,32 @@
{ stdenv, lib, fetchFromGitHub, buildGoModule, ... }:
let
version = "1.80.9";
src = fetchFromGitHub {
owner = "storj";
repo = "storj";
rev = "v${version}";
hash = "sha256-2YeBAwBpoMBRmIpNo7Vh81rtBKxJHyz817Fq0jsf1yc=";
};
meta = with lib; {
description = "Storj is building a distributed cloud storage network.";
homepage = "https://github.com/storj/storj";
license = licenses.agpl3Only;
maintainers = [{
email = "jake@hillion.co.uk";
matrix = "@jake:hillion.co.uk";
name = "Jake Hillion";
github = "JakeHillion";
githubId = 5712856;
}];
};
in
buildGoModule rec {
pname = "storagenode";
inherit version src meta;
vendorHash = "sha256-Sz/aM1mYpYnnVc6PTfldaiHQPT8TZCPfB6vQpzM2GDo=";
subPackages = [
"cmd/storagenode"
"cmd/identity"
];
}