Skip to content

Setup nix #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
watch_dir nix
use flake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
.direnv/
19 changes: 19 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
As a requirement under the hyperledger foundation, all commits must be signed off. This can be done by adding the `-s` flag every time you commit.

An alternative is to add the follow git hook (at `.git/hooks/prepare-commit-msg`):

```
#!/bin/sh

Expand All @@ -30,4 +31,22 @@ git interpret-trailers --if-exists doNothing --trailer \

it is also recommended (but not required) to add a gpg key: https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account

### repo tooling

The easiest way to setup the repo for development is to install [direnv](https://direnv.net/) and the [nix package manager](https://nixos.org/). This guarantees that all contributors have identical dev environments on their machine. If set up correctly, then `cd`-ing into the repo root will automatically install all build tooling dependencies. To check that you've done this successfully, run

```sh
$ which node
/nix/store/gxr9abzyqmva25p3k142qs1djj9q5fqw-nodejs-22.14.0/bin/node
```

you should see an output similar to the above.

#### manual setup

If you'd rather avoid installing and using Nix, then ensure you've installed the following packages and their respective versions on your machine.

| Package | Version |
| ------- | ------- |
| NodeJS | 22.14.0 |
| NPM | 10.9.2 |
61 changes: 61 additions & 0 deletions flake.lock

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

19 changes: 19 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
description = "Splice Wallet Kernel";

inputs = {
nixpkgs.url = "nixpkgs/b97cce1538cc03ffe511dbcbf0ec8fe0f2c8a269";
flake-utils.url = "github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; config = { allowUnfree = true; }; };
in
{
devShells.default = import ./nix/shell.nix { inherit pkgs; };
}
);
}
6 changes: 6 additions & 0 deletions nix/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ pkgs }:
pkgs.mkShell {
packages = with pkgs; [
nodejs
];
}