this repo has no description

add rust bits to nix config

Akshay d042b5f2 54b83031

+43 -1
flake.lock
··· 1 1 { 2 2 "nodes": { 3 + "gitignore": { 4 + "inputs": { 5 + "nixpkgs": [ 6 + "nixpkgs" 7 + ] 8 + }, 9 + "locked": { 10 + "lastModified": 1709087332, 11 + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", 12 + "owner": "hercules-ci", 13 + "repo": "gitignore.nix", 14 + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", 15 + "type": "github" 16 + }, 17 + "original": { 18 + "owner": "hercules-ci", 19 + "repo": "gitignore.nix", 20 + "type": "github" 21 + } 22 + }, 3 23 "nixpkgs": { 4 24 "locked": { 5 25 "lastModified": 1737753923, ··· 17 37 }, 18 38 "root": { 19 39 "inputs": { 20 - "nixpkgs": "nixpkgs" 40 + "gitignore": "gitignore", 41 + "nixpkgs": "nixpkgs", 42 + "rust-overlay": "rust-overlay" 43 + } 44 + }, 45 + "rust-overlay": { 46 + "inputs": { 47 + "nixpkgs": [ 48 + "nixpkgs" 49 + ] 50 + }, 51 + "locked": { 52 + "lastModified": 1737685583, 53 + "narHash": "sha256-p+NVABRpGi+pT+xxf9HcLcFVxG6L+vEEy+NwzB9T0f8=", 54 + "owner": "oxalica", 55 + "repo": "rust-overlay", 56 + "rev": "eb64cbcc8eee0fa87ebded92805280d2ec97415a", 57 + "type": "github" 58 + }, 59 + "original": { 60 + "owner": "oxalica", 61 + "repo": "rust-overlay", 62 + "type": "github" 21 63 } 22 64 } 23 65 },
+47 -25
flake.nix
··· 1 1 { 2 2 description = "atproto github"; 3 3 4 - inputs.nixpkgs.url = "github:nixos/nixpkgs"; 4 + inputs = { 5 + nixpkgs.url = "github:nixos/nixpkgs"; 5 6 6 - outputs = 7 - { self 8 - , nixpkgs 9 - , 10 - }: 11 - let 12 - supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; 13 - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 14 - nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); 15 - in 16 - { 17 - defaultPackage = forAllSystems (system: self.packages.${system}.legit); 18 - devShells = forAllSystems (system: 19 - let 20 - pkgs = nixpkgsFor.${system}; 21 - in 22 - { 23 - default = pkgs.mkShell { 24 - nativeBuildInputs = with pkgs; [ 25 - go 26 - air 27 - ]; 28 - }; 29 - }); 7 + gitignore = { 8 + url = "github:hercules-ci/gitignore.nix"; 9 + inputs.nixpkgs.follows = "nixpkgs"; 30 10 }; 11 + 12 + rust-overlay = { 13 + url = "github:oxalica/rust-overlay"; 14 + inputs.nixpkgs.follows = "nixpkgs"; 15 + }; 16 + }; 17 + 18 + outputs = { 19 + self, 20 + nixpkgs, 21 + gitignore, 22 + rust-overlay, 23 + }: let 24 + supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; 25 + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 26 + nixpkgsFor = forAllSystems (system: 27 + import nixpkgs { 28 + inherit system; 29 + overlays = [(import rust-overlay)]; 30 + }); 31 + in { 32 + defaultPackage = forAllSystems (system: self.packages.${system}.legit); 33 + formatter = forAllSystems (system: nixpkgsFor."${system}".alejandra); 34 + devShells = forAllSystems (system: let 35 + pkgs = nixpkgsFor.${system}; 36 + rust-bin = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; 37 + in { 38 + default = pkgs.mkShell { 39 + nativeBuildInputs = [ 40 + pkgs.go 41 + pkgs.air 42 + 43 + pkgs.bacon 44 + rust-bin 45 + pkgs.pkg-config 46 + pkgs.openssl 47 + ]; 48 + RUST_LOG = "info"; 49 + RUST_BACKTRACE = 1; 50 + }; 51 + }); 52 + }; 31 53 }
+4
rust-toolchain.toml
··· 1 + [toolchain] 2 + channel = "nightly-2025-01-20" 3 + components = [ "rustfmt", "rustc", "rust-analyzer", "rust-src", "rust-std", "cargo" ] 4 + profile = "default"