diff --git a/flake.lock b/flake.lock index 3b8bffd..d86f351 100644 --- a/flake.lock +++ b/flake.lock @@ -17,24 +17,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nix-darwin": { "inputs": { "nixpkgs": "nixpkgs" @@ -85,25 +67,9 @@ "root": { "inputs": { "brew-src": "brew-src", - "flake-utils": "flake-utils", "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs_2" } - }, - "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 ce0f4f6..23029de 100644 --- a/flake.nix +++ b/flake.nix @@ -4,35 +4,40 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nix-darwin.url = "github:LnL7/nix-darwin"; - flake-utils.url = "github:numtide/flake-utils"; brew-src = { url = "github:Homebrew/brew/4.4.5"; flake = false; }; }; - outputs = { self, nixpkgs, nix-darwin, flake-utils, brew-src, ... } @ inputs: let + outputs = { self, nixpkgs, nix-darwin, brew-src, ... } @ inputs: let # System types to support. supportedSystems = [ "x86_64-darwin" "aarch64-darwin" ]; flakeLock = builtins.fromJSON (builtins.readFile ./flake.lock); brewVersion = flakeLock.nodes.brew-src.original.ref; - in flake-utils.lib.eachSystem supportedSystems (system: let - pkgs = nixpkgs.legacyPackages.${system}; + + forAllSystems = + function: + nixpkgs.lib.genAttrs supportedSystems ( + system: function nixpkgs.legacyPackages.${system} + ); in { - packages = pkgs.callPackage ./pkgs { + packages = forAllSystems (pkgs: pkgs.callPackage ./pkgs { inherit inputs; - }; - devShell = pkgs.mkShell { + }); + + devShell = forAllSystems (pkgs: pkgs.mkShell { nativeBuildInputs = with pkgs; [ ]; BREW_SRC = brew-src; - }; - ci = import ./ci (inputs // { - inherit pkgs; }); - }) // { + + ci = forAllSystems (pkgs: import ./ci (inputs // { + inherit pkgs; + })); + darwinModules = { nix-homebrew = { lib, ... }: { imports = [