diff --git a/flake.lock b/flake.lock index 886e08e..277f342 100644 --- a/flake.lock +++ b/flake.lock @@ -16,24 +16,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1708161998, @@ -53,24 +35,8 @@ "root": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } - }, - "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 e535fa6..d44efe3 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,6 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - flake-utils.url = "github:numtide/flake-utils"; # Used for shell.nix flake-compat = { @@ -15,11 +14,22 @@ outputs = { self, nixpkgs, - flake-utils, ... }: let + inherit (nixpkgs) lib; + + # flake-utils polyfill + eachSystem = systems: fn: + lib.foldl' ( + acc: system: + lib.recursiveUpdate + acc + (lib.mapAttrs (_: value: {${system} = value;}) (fn system)) + ) {} + systems; + systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; - outputs = flake-utils.lib.eachSystem systems (system: let + outputs = eachSystem systems (system: let pkgs = nixpkgs.legacyPackages.${system}; in rec { # The packages exported by the Flake: @@ -33,7 +43,10 @@ # this will use the latest default. apps = rec { default = apps.zig; - zig = flake-utils.lib.mkApp {drv = packages.default;}; + zig = { + type = "app"; + program = toString packages.default; + }; }; # nix fmt