1
0
Fork 0
mirror of https://github.com/mitchellh/zig-overlay.git synced 2025-05-09 11:06:02 +03:00

drop flake-utils

Using these few lines of polyfill should help avoid end user's
flake.lock being polluted with sometimes hard to deduplicate
dependencies (i.e., ghostty)
This commit is contained in:
seth 2024-11-16 05:28:50 -05:00
parent 641fd92b6e
commit 7dd1f3eda2
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
2 changed files with 17 additions and 38 deletions

View file

@ -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