diff --git a/flake.lock b/flake.lock index 3bc2a40..cd7dcd1 100644 --- a/flake.lock +++ b/flake.lock @@ -1,25 +1,97 @@ { "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1738737274, + "narHash": "sha256-NhaD1K37YwlzN60kvJxlJ/VlYz8IiWk/yYusdvxTZsE=", + "owner": "nix-community", + "repo": "fenix", + "rev": "f82de9980822f3b1efcf54944939b1d514386827", + "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": 1737885589, - "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", - "owner": "nixos", + "lastModified": 1738680400, + "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", + "rev": "799ba5bffed04ced7067a91798353d360788b30d", "type": "github" }, "original": { - "owner": "nixos", + "id": "nixpkgs", "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "indirect" } }, "root": { "inputs": { + "fenix": "fenix", + "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1738698211, + "narHash": "sha256-jDKei3Lge74G2ez/Cm7brVCXdugjCdMAnaCEVHffIKA=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "6fb64beb807b07dc687fd0f00261c7c404a83947", + "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", diff --git a/flake.nix b/flake.nix index c0ee193..9633d6d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,22 +1,42 @@ { - description = "A very basic flake"; + description = "binary-room"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs.url = "nixpkgs/nixos-unstable"; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs }: let - pkgs = import nixpkgs { - system = "x86_64-linux"; - }; - in { - devShells.x86_64-linux.default = pkgs.mkShell { - # Use the same mkShell as documented above - packages = with pkgs; [ - # TODO: @Anthony, you can change this to use Fenix if you would like - rustup - ]; - }; - }; + outputs = { self, nixpkgs, fenix, flake-utils }: + flake-utils.lib.eachDefaultSystem + (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ fenix.overlays.default ]; + }; + rustToolchain = fenix.packages."${system}".stable; + in + { + devShells.default = pkgs.mkShell { + nativeBuildInputs = [ + (rustToolchain.withComponents + [ + "cargo" + "clippy" + "rust-src" + "rustc" + "rustfmt" + ]) + ]; + packages = with pkgs; [ + rust-analyzer-nightly + ]; + }; + } + ); }