Skip to content

Commit

Permalink
feat: set up direnv, formatter and format flake (#133)
Browse files Browse the repository at this point in the history
* configure direnv

* chore(nix): configure formatter and run `nix fmt`
  • Loading branch information
steveej authored Aug 27, 2024
1 parent 77d740c commit 0f86dab
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if ! has nix_direnv_version || ! nix_direnv_version 3.0.5; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.5/direnvrc" "sha256-RuwIS+QKFj/T9M2TFXScjBsLR6V3A17YVoEW/Q6AZ1w="
fi

use flake . --fallback --keep-going
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ result
target/
worker/
.cargo/
.direnv/
40 changes: 18 additions & 22 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
description = "Template for Holochain app development";

inputs = {
versions.url = "github:holochain/holochain/holochain-0.3.0-beta-dev.45?dir=versions/weekly";
versions.inputs.holochain.url = "github:holochain/holochain/holochain-0.3.0-beta-dev.45";
versions.url =
"github:holochain/holochain/holochain-0.3.0-beta-dev.45?dir=versions/weekly";
versions.inputs.holochain.url =
"github:holochain/holochain/holochain-0.3.0-beta-dev.45";

holochain-flake.url = "github:holochain/holochain";
holochain-flake.inputs.versions.follows = "versions";
Expand All @@ -13,26 +15,20 @@
};

outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; }
{
systems = builtins.attrNames inputs.holochain-flake.devShells;
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = builtins.attrNames inputs.holochain-flake.devShells;

perSystem =
{ inputs'
, config
, pkgs
, system
, ...
}: {
perSystem = { inputs', config, pkgs, system, ... }: {
formatter = pkgs.nixfmt-rfc-style;

devShells.default = pkgs.mkShell {
inputsFrom = [ inputs'.holochain-flake.devShells.holonix ];
packages = [
pkgs.nodejs-18_x
pkgs.binaryen
# more packages go here
];
};
};
devShells.default = pkgs.mkShell {
inputsFrom = [ inputs'.holochain-flake.devShells.holonix ];
packages = [
pkgs.nodejs-18_x
pkgs.binaryen
# more packages go here
];
};
};
}
};
}

0 comments on commit 0f86dab

Please sign in to comment.