From 1a197af1a86567e78ad02263095334a537eaabe3 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Thu, 26 Feb 2026 19:47:40 +0100 Subject: [PATCH] update rust template --- rust-project/flake.nix | 17 ----------------- rust/flake.nix | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 17 deletions(-) delete mode 100644 rust-project/flake.nix create mode 100644 rust/flake.nix diff --git a/rust-project/flake.nix b/rust-project/flake.nix deleted file mode 100644 index db1b961..0000000 --- a/rust-project/flake.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - description = "Basic Rust project"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - }; - - outputs = { self, nixpkgs }: - let - system = "x86_64-linux"; - pkgs = import nixpkgs { inherit system; }; - in { - devShells.x86_64-linux.default = pkgs.mkShell { - packages = [ pkgs.rustup ]; - }; - }; -} diff --git a/rust/flake.nix b/rust/flake.nix new file mode 100644 index 0000000..bb64cc7 --- /dev/null +++ b/rust/flake.nix @@ -0,0 +1,22 @@ +{ + description = "Template for Rust"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system : + let + pkgs = import nixpkgs { inherit system; }; + in { + devShells.x86_64-linux.default = pkgs.mkShell { + packages = [ + pkgs.rustup pkgs.cargo pkgs.rustc-unwrapped + pkgs.rust-analyzer-unwrapped + ]; + }; + } + ); +}