Skip to content

Commit

Permalink
Merge pull request #143 from ngi-nix/hyperspace-autobase
Browse files Browse the repository at this point in the history
hyperspace-autobase: init at 1.0.0-alpha.9
  • Loading branch information
alejandrosame authored Dec 30, 2023
2 parents 14dc7fd + f8ae929 commit 8d5507c
Show file tree
Hide file tree
Showing 5 changed files with 4,183 additions and 7 deletions.
84 changes: 84 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
inputs.rust-overlay.inputs.flake-utils.follows = "flake-utils";
inputs.rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
inputs.dream2nix.url = "github:nix-community/dream2nix";
inputs.dream2nix.inputs.nixpkgs.follows = "nixpkgs";

outputs = {
self,
Expand All @@ -23,6 +25,7 @@
treefmt-nix,
sops-nix,
rust-overlay,
dream2nix,
...
}: let
inherit
Expand All @@ -41,6 +44,7 @@
nameValuePair
nixosSystem
filterAttrs
attrByPath
;

importPackages = pkgs: let
Expand Down Expand Up @@ -68,7 +72,7 @@

pkgsByName = import ./pkgs/by-name {
inherit (pkgs) lib;
inherit callPackage;
inherit callPackage dream2nix pkgs;
};

explicitPkgs = import ./pkgs {
Expand Down Expand Up @@ -114,7 +118,9 @@
system = flake-utils.lib.system.x86_64-linux;
pkgs = importNixpkgs system [self.overlays.default];
treefmtEval = loadTreefmt pkgs;
nonBrokenPkgs = filterAttrs (_: v: !v.meta.broken) self.packages.${system};
# Dream2nix is failing to pass through the meta attribute set.
# As a workaround, consider packages with empty meta as non-broken.
nonBrokenPkgs = filterAttrs (_: v: !(attrByPath ["meta" "broken"] false v)) self.packages.${system};
in {
# Github Actions executes `nix flake check` therefore this output
# should only contain derivations that can built within CI.
Expand Down
48 changes: 48 additions & 0 deletions pkgs/by-name/autobase/dream2.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
lib,
config,
dream2nix,
...
}: rec {
name = "autobase";
version = "1.0.0-alpha.9";

imports = [
dream2nix.modules.dream2nix.nodejs-package-lock-v3
dream2nix.modules.dream2nix.nodejs-granular-v3
];

mkDerivation = {
src = config.deps.fetchFromGitHub {
owner = "holepunchto";
repo = "autobase";
rev = "v${version}";
sha256 = "sha256-aKs39/9GG3tRq5UBBDWcz1h64kaCt+1Cru3C4fKv5RU=";
};

doCheck = true;
checkPhase = ''
npm run test
'';

meta = with lib; {
description = "Autobase lets you write concise multiwriter data structures with Hypercore";
homepage = "https://github.com/holepunchto/autobase";
license = licenses.mit;
};
};

deps = {nixpkgs, ...}: {
inherit
(nixpkgs)
fetchFromGitHub
stdenv
;

npm = nixpkgs.nodejs_16.pkgs.npm;
};

nodejs-package-lock-v3 = {
packageLockFile = ./package-lock.json;
};
}
Loading

0 comments on commit 8d5507c

Please sign in to comment.