From 46ce5fd8c081f179a509da423077f8372e63ffc4 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 13 Sep 2024 17:51:48 +0300 Subject: chore: remove redundant flake-utils dependency; add nix-systems Removes the redundant flake-utils dependency, and replaces multi-system handling logic with a minimal function (zero deps!) that supports [nix-systems](https://github.com/nix-systems). This gets rid of the unnecessary flake-utils dependency. Also see: * https://ayats.org/blog/no-flake-utils --- flake.nix | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 62dcb861..04681a1c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,20 +2,22 @@ description = "Quickstart configurations for the Nvim LSP client"; inputs.nixpkgs.url = "github:NixOS/nixpkgs"; - inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.systems.url = "github:nix-systems/default"; - outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (system: - let pkgs = nixpkgs.legacyPackages.${system}; in - rec { - devShell = pkgs.mkShell { - buildInputs = [ - pkgs.stylua - pkgs.luaPackages.luacheck - pkgs.luajitPackages.vusted - pkgs.selene - ]; - }; - } - ); + outputs = { self, nixpkgs, systems }: let + supportedSystems = nixpkgs.lib.genAttrs (import systems); + forEachSystem = function: supportedSystems (system: + function nixpkgs.legacyPackages.${system}); + in { + devShells = forEachSystem (pkgs: { + default = pkgs.mkShell { + packages = [ + pkgs.stylua + pkgs.luaPackages.luacheck + pkgs.luajitPackages.vusted + pkgs.selene + ]; + }; + }); + }; } -- cgit v1.2.3-70-g09d2