From 9e0a375494f7261dca08c50c87f038e4a0965b1d Mon Sep 17 00:00:00 2001 From: isabel Date: Sat, 1 Feb 2025 22:54:33 +0000 Subject: [PATCH] refactor: remove flake-utils its only used for generating system dependant outputs. it would have made more sense to use if systems were provided as a systems were provided as an input. --- flake.lock | 36 +----------------------------------- flake.nix | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 38 deletions(-) diff --git a/flake.lock b/flake.lock index 4f59bdc6..1ed33d33 100644 --- a/flake.lock +++ b/flake.lock @@ -35,41 +35,7 @@ "root": { "inputs": { "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs", - "utils": "utils" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index 6ce57830..5db65e51 100644 --- a/flake.nix +++ b/flake.nix @@ -8,14 +8,21 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - utils.url = "github:numtide/flake-utils"; flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; }; - outputs = { self, nixpkgs, utils, ... }@inputs: + outputs = { self, nixpkgs, ... }@inputs: let + inherit (nixpkgs) lib; + + eachSystem = + systems: fn: + lib.foldl' ( + acc: system: lib.recursiveUpdate acc (lib.mapAttrs (_: value: { ${system} = value; }) (fn system)) + ) { } systems; + in rec { overlay = final: prev: let system = final.stdenv.hostPlatform.system; @@ -153,7 +160,12 @@ }; overlays.default = overlay; } // - utils.lib.eachSystem (utils.lib.defaultSystems ++ ["aarch64-darwin"]) (system: + eachSystem [ + "aarch64-linux" + "aarch64-darwin" + "x86_64-darwin" + "x86_64-linux" + ] (system: let pkgs = import nixpkgs { inherit system;