From 35b4ac836be017464ba682921c9180f2aabb95a9 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Thu, 1 Feb 2024 23:37:05 -0700 Subject: [PATCH] flake: replace forAllSystems with eachSystem --- flake.lock | 18 +++++++++++++++++- flake.nix | 13 ++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index dc8c408..0c55fa2 100644 --- a/flake.lock +++ b/flake.lock @@ -93,7 +93,8 @@ "root": { "inputs": { "alejandra": "alejandra", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "systems": "systems" } }, "rust-analyzer-src": { @@ -112,6 +113,21 @@ "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 289e2a4..d4ed648 100644 --- a/flake.nix +++ b/flake.nix @@ -14,10 +14,13 @@ alejandra, }: let inherit (nixpkgs.lib) genAttrs; - forAllSystems = f: - genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system}); + eachSystem = fn: + genAttrs (import systems) (system: let + pkgs = import nixpkgs {localSystem.system = system;}; + in + fn system pkgs); in { - packages = forAllSystems (pkgs: + packages = eachSystem (_: pkgs: with pkgs; { default = stdenv.mkDerivation { name = "monolisa-nerdfont-patch"; @@ -40,11 +43,11 @@ }; }); - devShells = forAllSystems (pkgs: + devShells = eachSystem (_: pkgs: with pkgs; { default = mkShell {buildInputs = [fontforge python3 pre-commit];}; }); - formatter.x86_64-linux = alejandra.packages.x86_64-linux.default; + formatter = eachSystem (system: _: alejandra.packages.${system}.default); }; }