Skip to content
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

feat(nix): improve nix stuff #23

Merged
merged 2 commits into from
Apr 26, 2023
Merged
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
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