From c3594c64671f622386a6dab12cb97b9f44c1611e Mon Sep 17 00:00:00 2001 From: Awiteb Date: Thu, 1 May 2025 10:09:20 +0000 Subject: [PATCH] feat: Initialize the project Signed-off-by: Awiteb --- Cargo.lock | 7 ++++ Cargo.toml | 13 +++++++ flake.lock | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 39 +++++++++++++++++++++ rustfmt.toml | 22 ++++++++++++ src/main.rs | 19 +++++++++++ 6 files changed, 196 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 rustfmt.toml create mode 100644 src/main.rs diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..5a67fab --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "n34" +version = "0.0.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..099753f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "n34" +description = "A CLI to interact with NIP-34 and other stuff related to codes in nostr" +version = "0.0.0" +edition = "2024" +license = "GPL-3.0-or-later" +authors = ["Awiteb "] +readme = "README.md" +repository = "https://git.4rs.nl/awiteb/n34" +keywords = ["nostr", "NIP-34", "CLI"] +categories = ["command-line-utilities"] + +[dependencies] diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4953e2e --- /dev/null +++ b/flake.lock @@ -0,0 +1,96 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1745930157, + "narHash": "sha256-y3h3NLnzRSiUkYpnfvnS669zWZLoqqI6NprtLQ+5dck=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "46e634be05ce9dc6d4db8e664515ba10b78151ae", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1744536153, + "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1746067100, + "narHash": "sha256-6JeEbboDvRjLwB9kzCnmWj+f+ZnMtKOe5c2F1VBpaTs=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "026e8fedefd6b167d92ed04b195c658d95ffc7a5", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "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" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8026b5a --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + rust-overlay.url = "github:oxalica/rust-overlay"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + nixpkgs, + rust-overlay, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + overlays = [ (import rust-overlay) ]; + pkgs = import nixpkgs { inherit system overlays; }; + in + with pkgs; + { + devShells.default = mkShell { + packages = [ + just + cargo-msrv + git-cliff + ]; + + nativeBuildInputs = [ + (lib.hiPrio rust-bin.nightly."2025-04-30".rustfmt) + rust-bin.stable.latest.default + ]; + + buildInputs = [ ]; + }; + } + ); +} diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..5ebee70 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,22 @@ +unstable_features = true +style_edition = "2024" + +blank_lines_upper_bound = 2 +combine_control_expr = false +wrap_comments = true +condense_wildcard_suffixes = true +edition = "2024" +enum_discrim_align_threshold = 20 +force_multiline_blocks = true +format_code_in_doc_comments = true +format_generated_files = false +format_macro_matchers = true +format_strings = true +imports_layout = "HorizontalVertical" +newline_style = "Unix" +normalize_comments = true +reorder_impl_items = true +group_imports = "StdExternalCrate" +single_line_let_else_max_width = 0 +struct_field_align_threshold = 20 +use_try_shorthand = true diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..b2ba02a --- /dev/null +++ b/src/main.rs @@ -0,0 +1,19 @@ +// n34 - A CLI to interact with NIP-34 and other stuff related to codes in nostr +// Copyright (C) 2025 Awiteb +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +fn main() { + println!("Hello, world!"); +}