Skip to content

andresilva/polkadot.nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix-polkadot logo

polkadot.nix is a collection of Nix packages related to the Polkadot ecosystem.

Packages

Usage

You need to enable flakes support.

You can use polkadot.nix as a standalone flake or integrate it into your existing nix flake project.

Running directly via nix run

nix run "github:andresilva/polkadot.nix#polkadot"

This will build and run the polkadot package from the flake. Check all available outputs with:

nix flake show "github:andresilva/polkadot.nix"

Integrate into existing flake

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs";
    polkadot.url = "github:andresilva/polkadot.nix";
    polkadot.inputs.nixpkgs.follows = "nixpkgs";
  };
  outputs =
    { nixpkgs, polkadot, ... }:
    let
      system = "x86_64-linux";
    in
    {
      devShells.${system}.default = nixpkgs.legacyPackages.${system}.mkShell {
        buildInputs = [ polkadot.packages.${system}.polkadot ];
      };
    };
}

Overlay

You can use polkadot.nix as an overlay to seamlessly integrate all Polkadot packages into your existing nixpkgs environment.

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs";
    polkadot.url = "github:andresilva/polkadot.nix";
    polkadot.inputs.nixpkgs.follows = "nixpkgs";
  };
  outputs =
    { nixpkgs, polkadot, ... }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs {
        inherit system;
        overlays = [ polkadot.overlays.default ];
      };
    in
    {
      packages.${system}.default = pkgs.polkadot;
    };
}

Cachix

Use Cachix to speed up builds by fetching pre-built binaries from a remote cache, reducing compilation times and improving overall efficiency.

cachix use polkadot

Development shell

A shell derivation is included that provides a development environment with all the requirements necessary to build polkadot-sdk.

You can run it directly with:

nix develop "github:andresilva/polkadot.nix"

You can also integrate it into a flake and override it with more packages:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs";
    polkadot.url = "github:andresilva/polkadot.nix";
    polkadot.inputs.nixpkgs.follows = "nixpkgs";
  };
  outputs =
    { nixpkgs, polkadot, ... }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs {
        inherit system;
        overlays = [ polkadot.overlays.default ];
      };
    in
    {
      devShells.${system}.default = polkadot.devShells.${system}.default.overrideAttrs (attrs: {
        nativeBuildInputs = with pkgs; attrs.nativeBuildInputs ++ [ zombienet ];
      });
    };
}

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages