From d4fffab9622f772cf9585a4e91f7b0125891387e Mon Sep 17 00:00:00 2001 From: bit Date: Thu, 7 Aug 2025 09:02:49 +0200 Subject: [PATCH] initial commit --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d28c495 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1754214453, + "narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b08e94e --- /dev/null +++ b/flake.nix @@ -0,0 +1,41 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = + { self, nixpkgs }: + let + defaultSystems = [ + "aarch64-linux" + "aarch64-darwin" + "x86_64-darwin" + "x86_64-linux" + ]; + forAllDefaultSystems = f: nixpkgs.lib.genAttrs defaultSystems (system: f system); + in + { + devShells = forAllDefaultSystems ( + system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + #default = self.devShells."${system}".; + + rust = pkgs.mkShell { + buildInputs = with pkgs; [ + rustc + cargo + gcc + rustfmt + clippy + ]; + }; + + } + ); + + formatter = forAllDefaultSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-tree); + }; +}