From 7cdfb8b99011d8aed66810cd34ff67e207135c8a Mon Sep 17 00:00:00 2001 From: Sergey Yakovlev Date: Tue, 10 Jan 2023 22:28:40 +0200 Subject: [PATCH] Init --- .gitignore | 11 +++ flake.lock | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 43 +++++++++++ 3 files changed, 264 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5bc0878 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Nix +.direnv +.envrc + +# Go +main + +# Test +podman-data +keystores +wallets diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..48fbcdc --- /dev/null +++ b/flake.lock @@ -0,0 +1,210 @@ +{ + "nodes": { + "ethereum-nix": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "flake-root": "flake-root", + "foundry-nix": "foundry-nix", + "mission-control": "mission-control", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-unstable": "nixpkgs-unstable", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1677773622, + "narHash": "sha256-7bsxh2pBvm/RHuR2Ki/p1S28RKa6kkJrJkn1Uq/Nan4=", + "owner": "nix-community", + "repo": "ethereum.nix", + "rev": "801fd3d39e91902fcc375217d9ebe64f4d1ca23f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "ethereum.nix", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "ethereum-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1675933616, + "narHash": "sha256-/rczJkJHtx16IFxMmAWu5nNYcSXNg1YYXTHoGjLrLUA=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "47478a4a003e745402acf63be7f9a092d51b83d7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-root": { + "locked": { + "lastModified": 1671378805, + "narHash": "sha256-yqGxyzMN2GuppwG3dTWD1oiKxi+jGYP7D1qUSc5vKhI=", + "owner": "srid", + "repo": "flake-root", + "rev": "dc7ba6166e478804a9da6881aa48c45d300075cf", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "flake-root", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "foundry-nix": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "ethereum-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1675801109, + "narHash": "sha256-18nucjxdQa0qY4v/2o3ksLjJ84vx3L+zIB87sjRKbrA=", + "owner": "shazow", + "repo": "foundry.nix", + "rev": "5e998c1666007ede721f8290aab2f9529d2ccef7", + "type": "github" + }, + "original": { + "owner": "shazow", + "ref": "monthly", + "repo": "foundry.nix", + "type": "github" + } + }, + "mission-control": { + "locked": { + "lastModified": 1675195908, + "narHash": "sha256-nQv35C7svZFluwy2uoZFxwPqiT16XoKAoMlIQYmvg3A=", + "owner": "Platonic-Systems", + "repo": "mission-control", + "rev": "feb06872ac4dc977f70f6388c87d36fc3c3c3693", + "type": "github" + }, + "original": { + "owner": "Platonic-Systems", + "repo": "mission-control", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1677407201, + "narHash": "sha256-3blwdI9o1BAprkvlByHvtEm5HAIRn/XPjtcfiunpY7s=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7f5639fa3b68054ca0b062866dc62b22c3f11505", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1677383253, + "narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "9952d6bc395f5841262b006fbace8dd7e143b634", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1677852945, + "narHash": "sha256-liiVJjkBTuBTAkRW3hrI8MbPD2ImYzwUpa7kvteiKhM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f5ffd5787786dde3a8bf648c7a1b5f78c4e01abb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "ethereum-nix": "ethereum-nix", + "nixpkgs": "nixpkgs_2" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1676131462, + "narHash": "sha256-EaWq2jUIGbXW6Tp66mbwZXEXRZ3y4W+4NTWiBFYNBxw=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "819dd7f076832838bba238eceef9a3dbfc63f5d0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..26953f6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "Key Converter"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + 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; }; + + key-converter = pkgs.buildGoModule { + pname = "key-converter"; + version = "0.1.0"; + src = ./.; + }; + in { + packages."x86_64-linux".key-converter = key-converter; + packages."x86_64-linux".default = self.packages."${system}".key-converter; + apps."x86_64-linux".key-converter = { + type = "app"; + program = "${self.packages.x86_64-linux.default}/bin/key-converter"; + }; + apps."x86_64-linux".default = self.apps."${system}".key-converter; + + 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 + ]; + }; + }; +}