From e980f7a46e88e6b94e0fd993586c25cef0ab4717 Mon Sep 17 00:00:00 2001 From: Slendi Date: Tue, 9 Sep 2025 01:01:00 +0300 Subject: [PATCH] stuff Signed-off-by: Slendi --- .envrc | 1 + .gitignore | 2 ++ Cargo.toml | 6 ++++ flake.lock | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 70 ++++++++++++++++++++++++++++++++++++++ src/main.rs | 3 ++ 6 files changed, 180 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 src/main.rs diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d5df85 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +.direnv diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..507a2a9 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "wordlers" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..42c2f78 --- /dev/null +++ b/flake.lock @@ -0,0 +1,98 @@ +{ + "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1757313768, + "narHash": "sha256-HWd3/TgXubNWsGB9EgDocxSy2VR7k1kh97c3eAw/GDw=", + "owner": "nix-community", + "repo": "fenix", + "rev": "7a988bb002e235030492c94666f46737d583fad1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "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": 1757068644, + "narHash": "sha256-NOrUtIhTkIIumj1E/Rsv1J37Yi3xGStISEo8tZm3KW4=", + "rev": "8eb28adfa3dc4de28e792e3bf49fcf9007ca8ac9", + "revCount": 856926, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.856926%2Brev-8eb28adfa3dc4de28e792e3bf49fcf9007ca8ac9/019921d1-c8bb-7ab1-9a48-c4f8bca22352/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1" + } + }, + "root": { + "inputs": { + "fenix": "fenix", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1757042294, + "narHash": "sha256-JMLa0ZsbEd3+3E0/PQj/igVi9+pb98TgxaOEEw+t1bo=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "a53b44412d4643cdec41005129735b38737eb296", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "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..1fc9393 --- /dev/null +++ b/flake.nix @@ -0,0 +1,70 @@ +{ + description = "Rust flake"; + + inputs = { + nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; + flake-utils.url = "github:numtide/flake-utils"; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { + nixpkgs, + flake-utils, + fenix, + ... + }: + let + overlay = + final: prev: + let + fenixPkgs = fenix.packages.${final.system}; + in + { + rustToolchain = + with fenixPkgs; + combine ( + with stable; + [ + clippy + rustc + cargo + rustfmt + rust-src + ] + ); + }; + in + { + overlays.default = overlay; + } + // flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ overlay ]; + }; + in + { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + rustToolchain + openssl + pkg-config + cargo-deny + cargo-edit + cargo-watch + rust-analyzer + ]; + + shellHook = '' + export RUST_SRC_PATH="${pkgs.rustToolchain}/lib/rustlib/src/rust/library" + ''; + }; + } + ); +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}