diff options
| -rw-r--r-- | flake.lock | 23 | ||||
| -rw-r--r-- | flake.nix | 30 |
2 files changed, 50 insertions, 3 deletions
@@ -34,7 +34,28 @@ "root": { "inputs": { "nix-filter": "nix-filter", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1727663505, + "narHash": "sha256-83j/GrHsx8GFUcQofKh+PRPz6pz8sxAsZyT/HCNdey8=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "c2099c6c7599ea1980151b8b6247a8f93e1806ee", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } } }, @@ -5,6 +5,13 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nix-filter.url = "github:numtide/nix-filter"; + + # NOTE: This is not necessary for end users + # You can omit it with `inputs.rust-overlay.follows = ""` + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -12,6 +19,7 @@ self, nixpkgs, nix-filter, + rust-overlay, }: let inherit (nixpkgs) lib; @@ -30,11 +38,29 @@ devShells = forAllSystems ( system: let + pkgs = nixpkgsFor.${system}; inherit (self.packages.${system}) niri; in { - default = nixpkgsFor.${system}.mkShell { - inputsFrom = [ niri ]; + default = pkgs.mkShell { + packages = [ + # NOTE: Nixpkgs' Rust toolchain isn't used here as we prefer + # a nightly toolchain for development, and *require* a nightly + # `rustfmt` + rust-overlay.packages.${system}.rust-nightly + + pkgs.rust-analyzer + ]; + + nativeBuildInputs = [ + pkgs.clang + pkgs.pkg-config + pkgs.wrapGAppsHook4 # For `niri-visual-tests` + ]; + + buildInputs = niri.buildInputs ++ [ + pkgs.libadwaita # For `niri-visual-tests` + ]; env = { inherit (niri) LIBCLANG_PATH; |
