Skip to content

Commit

Permalink
feat(nix): improve nix stuff (#23)
Browse files Browse the repository at this point in the history
Improve some nix stuff

Close #5
  • Loading branch information
selfuryon authored Apr 26, 2023
1 parent 6745262 commit caee3f0
Show file tree
Hide file tree
Showing 14 changed files with 421 additions and 49 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Nix
.direnv
.envrc
result
.pre-commit-config.yaml

# Go
main
dkc

# Test
podman-data
keystores
dkc
.key
3 changes: 1 addition & 2 deletions example/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ func sample2() {
var rk bls.SecretKey
if err := rk.Recover(subSKs, subIDs); err != nil {
}
fmt.Printf("Recovered key=%v\n", rk.SerializeToHexStr())

fmt.Printf("Recovered key=%v\n", rk.SerializeToHexStr())

}

Expand Down
211 changes: 199 additions & 12 deletions flake.lock

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

68 changes: 35 additions & 33 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,44 @@
description = "Dirk Key Converter";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

# flake-parts
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
flake-root.url = "github:srid/flake-root";
pre-commit-hooks-nix = {
url = "github:hercules-ci/pre-commit-hooks.nix/flakeModule";
inputs.nixpkgs.follows = "nixpkgs";
};
mission-control.url = "github:Platonic-Systems/mission-control";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
statix = {
url = "github:nerdypepper/statix";
inputs.nixpkgs.follows = "nixpkgs";
};

# ethereum utils
ethereum-nix = {
url = "github:nix-community/ethereum.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, ethereum-nix }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };

dkc = pkgs.buildGoModule {
pname = "dkc";
version = "0.1.0";
src = ./.;
};
in {
packages."x86_64-linux".key-converter = dkc;
packages."x86_64-linux".default = self.packages."${system}".dkc;
apps."x86_64-linux".dkc = {
type = "app";
program = "${self.packages.x86_64-linux.default}/bin/dkc";
};
apps."x86_64-linux".default = self.apps."${system}".dkc;

devShells."x86_64-linux".default = pkgs.mkShell {
buildInputs = with pkgs; [
ethereum-nix.packages.x86_64-linux.ethdo
go
go-outline
golangci-lint
gopkgs
gopls
gotools
openssl
];
};
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {
inherit inputs;
}
{
imports = [
inputs.flake-parts.flakeModules.easyOverlay
inputs.flake-root.flakeModule
inputs.mission-control.flakeModule
inputs.pre-commit-hooks-nix.flakeModule
./nix
];
systems = ["x86_64-linux" "aarch64-darwin"];
};
}
Loading

0 comments on commit caee3f0

Please sign in to comment.