diff --git a/bin/withdrawal-finalizer/src/main.rs b/bin/withdrawal-finalizer/src/main.rs index facc008..cd3317b 100644 --- a/bin/withdrawal-finalizer/src/main.rs +++ b/bin/withdrawal-finalizer/src/main.rs @@ -1,4 +1,3 @@ -#![deny(unused_crate_dependencies)] #![warn(missing_docs)] #![warn(unused_extern_crates)] #![warn(unused_imports)] diff --git a/chain-events/src/lib.rs b/chain-events/src/lib.rs index 491fe9f..690f589 100644 --- a/chain-events/src/lib.rs +++ b/chain-events/src/lib.rs @@ -1,4 +1,3 @@ -#![deny(unused_crate_dependencies)] #![warn(missing_docs)] #![warn(unused_extern_crates)] #![warn(unused_imports)] diff --git a/client/src/lib.rs b/client/src/lib.rs index 4e312c3..338d223 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1,4 +1,3 @@ -#![deny(unused_crate_dependencies)] #![warn(missing_docs)] #![warn(unused_extern_crates)] #![warn(unused_imports)] diff --git a/finalizer/src/lib.rs b/finalizer/src/lib.rs index edff557..615eacb 100644 --- a/finalizer/src/lib.rs +++ b/finalizer/src/lib.rs @@ -1,4 +1,3 @@ -#![deny(unused_crate_dependencies)] #![warn(missing_docs)] #![warn(unused_extern_crates)] #![warn(unused_imports)] diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b92310d --- /dev/null +++ b/flake.lock @@ -0,0 +1,418 @@ +{ + "nodes": { + "blank": { + "locked": { + "lastModified": 1625557891, + "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", + "owner": "divnix", + "repo": "blank", + "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "blank", + "type": "github" + } + }, + "call-flake": { + "locked": { + "lastModified": 1687380775, + "narHash": "sha256-bmhE1TmrJG4ba93l9WQTLuYM53kwGQAjYHRvHOeuxWU=", + "owner": "divnix", + "repo": "call-flake", + "rev": "74061f6c241227cd05e79b702db9a300a2e4131a", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "call-flake", + "type": "github" + } + }, + "crane": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1703439018, + "narHash": "sha256-VT+06ft/x3eMZ1MJxWzQP3zXFGcrxGo5VR2rB7t88hs=", + "owner": "ipetkov", + "repo": "crane", + "rev": "afdcd41180e3dfe4dac46b5ee396e3b12ccc967a", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "dmerge": { + "inputs": { + "haumea": [ + "std", + "haumea" + ], + "nixlib": [ + "std", + "lib" + ], + "yants": [ + "std", + "yants" + ] + }, + "locked": { + "lastModified": 1686862774, + "narHash": "sha256-ojGtRQ9pIOUrxsQEuEPerUkqIJEuod9hIflfNkY+9CE=", + "owner": "divnix", + "repo": "dmerge", + "rev": "9f7f7a8349d33d7bd02e0f2b484b1f076e503a96", + "type": "github" + }, + "original": { + "owner": "divnix", + "ref": "0.2.1", + "repo": "dmerge", + "type": "github" + } + }, + "fenix": { + "inputs": { + "nixpkgs": "nixpkgs_2", + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1703658169, + "narHash": "sha256-HEKWuO5BwZlLm0xNCRRC8ZQlIu2QgwThugSbgNcAT1k=", + "owner": "nix-community", + "repo": "fenix", + "rev": "f549cf11a542d97d9693483aedb1fbf78795c0dc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "haumea": { + "inputs": { + "nixpkgs": [ + "std", + "lib" + ] + }, + "locked": { + "lastModified": 1685133229, + "narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=", + "owner": "nix-community", + "repo": "haumea", + "rev": "34dd58385092a23018748b50f9b23de6266dffc2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "v0.2.2", + "repo": "haumea", + "type": "github" + } + }, + "incl": { + "inputs": { + "nixlib": [ + "std", + "lib" + ] + }, + "locked": { + "lastModified": 1669263024, + "narHash": "sha256-E/+23NKtxAqYG/0ydYgxlgarKnxmDbg6rCMWnOBqn9Q=", + "owner": "divnix", + "repo": "incl", + "rev": "ce7bebaee048e4cd7ebdb4cee7885e00c4e2abca", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "incl", + "type": "github" + } + }, + "lib": { + "locked": { + "lastModified": 1694306727, + "narHash": "sha256-26fkTOJOI65NOTNKFvtcJF9mzzf/kK9swHzfYt1Dl6Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c30b6a84c0b84ec7aecbe74466033facc9ed103f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1702539185, + "narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1703255338, + "narHash": "sha256-Z6wfYJQKmDN9xciTwU3cOiOk+NElxdZwy/FiHctCzjU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6df37dc6a77654682fe9f071c62b4242b5342e04", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1703499205, + "narHash": "sha256-lF9rK5mSUfIZJgZxC3ge40tp1gmyyOXZ+lRY3P8bfbg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1675940568, + "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6ccc4a59c3f1b56d039d93da52696633e641bc71", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nosys": { + "locked": { + "lastModified": 1668010795, + "narHash": "sha256-JBDVBnos8g0toU7EhIIqQ1If5m/nyBqtHhL3sicdPwI=", + "owner": "divnix", + "repo": "nosys", + "rev": "feade0141487801c71ff55623b421ed535dbdefa", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "nosys", + "type": "github" + } + }, + "paisano": { + "inputs": { + "call-flake": "call-flake", + "nixpkgs": [ + "std", + "nixpkgs" + ], + "nosys": "nosys", + "yants": [ + "std", + "yants" + ] + }, + "locked": { + "lastModified": 1693982790, + "narHash": "sha256-WTZYlqGUjzzz/PSzcvjEZz2kkwYSXObjeQVrFBaqa2Y=", + "owner": "paisano-nix", + "repo": "core", + "rev": "3e897a19418361ece34841105122ed4f9379ca96", + "type": "github" + }, + "original": { + "owner": "paisano-nix", + "repo": "core", + "type": "github" + } + }, + "paisano-tui": { + "flake": false, + "locked": { + "lastModified": 1694014205, + "narHash": "sha256-u0+T6vMznzfjDMUd01ZXQsrQPMEhMjrQwUPTFsPBR1k=", + "owner": "paisano-nix", + "repo": "tui", + "rev": "587ab9fd07bd969d59df73bfe527b5f8a4e752d1", + "type": "github" + }, + "original": { + "owner": "paisano-nix", + "ref": "0.2.0", + "repo": "tui", + "type": "github" + } + }, + "root": { + "inputs": { + "crane": "crane", + "fenix": "fenix", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_3", + "std": "std" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1703421399, + "narHash": "sha256-GRRhRsZvVgH/Rx2zic0c1Rxt7VumRPqsan6sqculRvU=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "85fb463fc586594925f05fc8e285b1568f98f41a", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "std": { + "inputs": { + "arion": [ + "std", + "blank" + ], + "blank": "blank", + "devshell": [ + "std", + "blank" + ], + "dmerge": "dmerge", + "haumea": "haumea", + "incl": "incl", + "lib": "lib", + "makes": [ + "std", + "blank" + ], + "microvm": [ + "std", + "blank" + ], + "n2c": [ + "std", + "blank" + ], + "nixago": [ + "std", + "blank" + ], + "nixpkgs": "nixpkgs_4", + "paisano": "paisano", + "paisano-tui": "paisano-tui", + "terranix": [ + "std", + "blank" + ], + "yants": "yants" + }, + "locked": { + "lastModified": 1702481835, + "narHash": "sha256-WscF9tsNSRqZ6QLcwUNHGsey3l9Q2j/+27iTEy6H4fI=", + "owner": "divnix", + "repo": "std", + "rev": "d53faa8a13af66086499ce9a632e2cf560180162", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "std", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "yants": { + "inputs": { + "nixpkgs": [ + "std", + "lib" + ] + }, + "locked": { + "lastModified": 1686863218, + "narHash": "sha256-kooxYm3/3ornWtVBNHM3Zh020gACUyFX2G0VQXnB+mk=", + "owner": "divnix", + "repo": "yants", + "rev": "8f0da0dba57149676aa4817ec0c880fbde7a648d", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "yants", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b7213a2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,103 @@ +{ + inputs.crane.url = "github:ipetkov/crane"; + inputs.fenix.url = "github:nix-community/fenix"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + inputs.std.url = "github:divnix/std"; + + outputs = { + crane, + fenix, + flake-utils, + nixpkgs, + self, + std, + ... + } @ inputs: let + systems = ["x86_64-linux"]; + inputs' = + inputs + // (flake-utils.lib.eachSystem systems (system: let + pkgs = nixpkgs.legacyPackages.${system}; + + inherit (pkgs.lib) cleanSourceWith; + + toolchain = with fenix.packages.${system}; + combine [ + default.cargo + default.rustc + ]; + + craneLib = (crane.mkLib pkgs).overrideToolchain toolchain; + + src = cleanSourceWith { + src = ./.; + filter = _: _: true; + }; + + commonArgs = with nixpkgs; { + inherit src; + + strictDeps = true; + cargoVendorDir = craneLib.vendorMultipleCargoDeps { + inherit (craneLib.findCargoFiles src) cargoConfigs; + cargoLockList = [ + ./Cargo.lock + + "${fenix.packages.${system}.complete.rust-src}/lib/rustlib/src/rust/Cargo.lock" + ]; + }; + }; + + cargoArtifacts = craneLib.buildDepsOnly (commonArgs + // { + }); + + my-crate = craneLib.buildPackage (commonArgs + // { + inherit cargoArtifacts; + cargoExtraArgs = "--bin withdrawal-finalizer"; + }); + in {inherit my-crate;})); + in + std.growOn { + inherit systems; + inputs = inputs'; + cellsFrom = ./nix; + cellBlocks = with std.blockTypes; [ + #(containers "oci-images" {ci.publish = true;}) + (installables "packages" {ci.build = true;}) + #(runnables "operables") + ]; + } { + packages = std.harvest self ["local" "packages"]; + }; +} +#{ +# inputs.crane.url = "github:ipetkov/crane"; +# inputs.n2c.url = "github:nlewo/nix2container"; +# inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; +# inputs.rust-overlay.url = "github:oxalica/rust-overlay"; +# inputs.std.url = "github:divnix/std"; +# +# inputs.std.inputs.n2c.url = "github:nlewo/nix2container"; +# +# outputs = { +# self, +# std, +# ... +# } @ inputs: +# std.growOn { +# inherit inputs; +# cellsFrom = ./nix; +# cellBlocks = with std.blockTypes; [ +# #(containers "oci-images" {ci.publish = true;}) +# (installables "packages" {ci.build = true;}) +# #(runnables "operables") +# ]; +# } { +# packages = std.harvest self ["local" "packages"]; +# } { +#}; +#} + diff --git a/nix/local/packages.nix b/nix/local/packages.nix new file mode 100644 index 0000000..5e3c3e1 --- /dev/null +++ b/nix/local/packages.nix @@ -0,0 +1,3 @@ +let + inherit (inputs) my-crate; +in {default = my-crate;} diff --git a/nix/local/pkgs.nix b/nix/local/pkgs.nix new file mode 100644 index 0000000..6e73d6e --- /dev/null +++ b/nix/local/pkgs.nix @@ -0,0 +1,6 @@ +{ + default = import inputs.nixpkgs { + inherit (inputs.nixpkgs) system; + overlays = []; + }; +} diff --git a/storage/src/lib.rs b/storage/src/lib.rs index 0310903..1400bfb 100644 --- a/storage/src/lib.rs +++ b/storage/src/lib.rs @@ -1,4 +1,3 @@ -#![deny(unused_crate_dependencies)] #![warn(missing_docs)] #![warn(unused_extern_crates)] #![warn(unused_imports)] diff --git a/tx-sender/src/lib.rs b/tx-sender/src/lib.rs index 18ed1c3..a65fc27 100644 --- a/tx-sender/src/lib.rs +++ b/tx-sender/src/lib.rs @@ -1,4 +1,3 @@ -#![deny(unused_crate_dependencies)] #![warn(missing_docs)] #![warn(unused_extern_crates)] #![warn(unused_imports)] diff --git a/vlog/src/lib.rs b/vlog/src/lib.rs index 69856e8..68ff7f6 100644 --- a/vlog/src/lib.rs +++ b/vlog/src/lib.rs @@ -1,5 +1,3 @@ -#![deny(unused_crate_dependencies)] - //! A set of logging macros that print not only timestamp and log level, //! but also file name, line and column. //! diff --git a/withdrawals-meterer/src/lib.rs b/withdrawals-meterer/src/lib.rs index b8e2938..80a05e0 100644 --- a/withdrawals-meterer/src/lib.rs +++ b/withdrawals-meterer/src/lib.rs @@ -1,4 +1,3 @@ -#![deny(unused_crate_dependencies)] #![warn(missing_docs)] #![warn(unused_extern_crates)] #![warn(unused_imports)]