From ad08391c61724e35000deee7912636fd028ec6a8 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Sat, 2 Nov 2024 20:18:12 -0700 Subject: [PATCH] add rust --- rust/flake.lock | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ rust/flake.nix | 25 +++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 rust/flake.lock create mode 100644 rust/flake.nix diff --git a/rust/flake.lock b/rust/flake.lock new file mode 100644 index 0000000..b526f6f --- /dev/null +++ b/rust/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1730272153, + "narHash": "sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z+w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixpkgs-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "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/rust/flake.nix b/rust/flake.nix new file mode 100644 index 0000000..c5f0be6 --- /dev/null +++ b/rust/flake.nix @@ -0,0 +1,25 @@ +{ + description = "Good basic flake template"; + inputs = { + nixpkgs.url = "nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + systempkgs = nixpkgs.legacyPackages.${system}; + in + { + devShells.default = systempkgs.mkShell { + buildInputs = with systempkgs; [ + # specific nodejs versions available, e.g. nodejs_18 + rustc + cargo + rust-analyzer + rustup + ]; + }; + } + ); +}