Skip to content

Commit

Permalink
drop flake-utils
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
getchoo committed Nov 16, 2024
1 parent 641fd92 commit 7dd1f3e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 38 deletions.
34 changes: 0 additions & 34 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 7dd1f3e

Please sign in to comment.