Skip to content

Commit

Permalink
add flake-compat
Browse files Browse the repository at this point in the history
  • Loading branch information
bbigras committed Jun 1, 2021
1 parent 48e82e9 commit d923561
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 17 deletions.
15 changes: 15 additions & 0 deletions build.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ pkgs, dendrite }:

with pkgs;
{
main = buildGoModule {
name = "nix-matrix-pinecone";

src = dendrite;

vendorSha256 = "sha256-Fs28HlNxyz/oU2FRxw7QV0xkN7VKgoZ6bYUx0HWHSP8=";
subPackages = [ "cmd/dendrite-demo-pinecone" ];
};

test = pkgs.nixosTest ./test.nix;
}
28 changes: 13 additions & 15 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{ pkgs, dendrite }:

with pkgs;
{
main = buildGoModule {
name = "nix-matrix-pinecone";

src = dendrite;

vendorSha256 = "sha256-Fs28HlNxyz/oU2FRxw7QV0xkN7VKgoZ6bYUx0HWHSP8=";
subPackages = [ "cmd/dendrite-demo-pinecone" ];
};

test = pkgs.nixosTest ./test.nix;
}
(import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{
src = ./.;
}).defaultNix
17 changes: 17 additions & 0 deletions flake.lock

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

8 changes: 6 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
url = "github:matrix-org/dendrite";
flake = false;
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};

outputs = { self, nixpkgs, flake-utils, dendrite }:
outputs = { self, nixpkgs, flake-utils, dendrite, flake-compat }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = import nixpkgs { inherit system; }; in
{
defaultPackage = (import ./default.nix { inherit pkgs dendrite; }).main;
defaultPackage = (import ./build.nix { inherit pkgs dendrite; }).main;
devShell = import ./shell.nix { inherit pkgs; };
}
);
Expand Down

0 comments on commit d923561

Please sign in to comment.