Skip to content

Commit f1bd616

Browse files
committed
refactor: remove flake-utils
1 parent 6a536c4 commit f1bd616

File tree

5 files changed

+52
-47
lines changed

5 files changed

+52
-47
lines changed

examples/complex/flake.nix

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
inputs = {
3-
flake-utils.url = "github:numtide/flake-utils";
43
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
54
nix-topology.url = "github:oddlama/nix-topology";
65
nix-topology.inputs.nixpkgs.follows = "nixpkgs";
@@ -10,9 +9,23 @@
109
self,
1110
nixpkgs,
1211
nix-topology,
13-
flake-utils,
1412
...
15-
}:
13+
}: let
14+
inherit (nixpkgs) lib;
15+
16+
eachSystem = systems: fn:
17+
lib.foldl' (
18+
acc: system: lib.recursiveUpdate acc (lib.mapAttrs (_: value: {${system} = value;}) (fn system))
19+
) {}
20+
systems;
21+
22+
systems = [
23+
"aarch64-darwin"
24+
"aarch64-linux"
25+
"x86_64-darwin"
26+
"x86_64-linux"
27+
];
28+
in
1629
{
1730
nixosConfigurations.host1 = nixpkgs.lib.nixosSystem {
1831
system = "x86_64-linux";
@@ -174,7 +187,7 @@
174187
];
175188
};
176189
}
177-
// flake-utils.lib.eachDefaultSystem (system: rec {
190+
// eachSystem systems (system: rec {
178191
pkgs = import nixpkgs {
179192
inherit system;
180193
overlays = [nix-topology.overlays.default];

examples/simple/flake.nix

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
inputs = {
3-
flake-utils.url = "github:numtide/flake-utils";
43
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
54
nix-topology.url = "github:oddlama/nix-topology";
65
nix-topology.inputs.nixpkgs.follows = "nixpkgs";
@@ -10,9 +9,23 @@
109
self,
1110
nixpkgs,
1211
nix-topology,
13-
flake-utils,
1412
...
15-
}:
13+
}: let
14+
inherit (nixpkgs) lib;
15+
16+
eachSystem = systems: fn:
17+
lib.foldl' (
18+
acc: system: lib.recursiveUpdate acc (lib.mapAttrs (_: value: {${system} = value;}) (fn system))
19+
) {}
20+
systems;
21+
22+
systems = [
23+
"aarch64-darwin"
24+
"aarch64-linux"
25+
"x86_64-darwin"
26+
"x86_64-linux"
27+
];
28+
in
1629
{
1730
nixosConfigurations.host1 = nixpkgs.lib.nixosSystem {
1831
system = "x86_64-linux";
@@ -97,7 +110,7 @@
97110
];
98111
};
99112
}
100-
// flake-utils.lib.eachDefaultSystem (system: rec {
113+
// eachSystem systems (system: rec {
101114
pkgs = import nixpkgs {
102115
inherit system;
103116
overlays = [nix-topology.overlays.default];

flake.lock

Lines changed: 0 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
inputs.nixpkgs.follows = "nixpkgs";
88
};
99

10-
flake-utils.url = "github:numtide/flake-utils";
1110
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
1211

1312
pre-commit-hooks = {
@@ -20,11 +19,25 @@
2019
outputs = {
2120
self,
2221
devshell,
23-
flake-utils,
2422
nixpkgs,
2523
pre-commit-hooks,
2624
...
27-
} @ inputs:
25+
} @ inputs: let
26+
inherit (nixpkgs) lib;
27+
28+
eachSystem = systems: fn:
29+
lib.foldl' (
30+
acc: system: lib.recursiveUpdate acc (lib.mapAttrs (_: value: {${system} = value;}) (fn system))
31+
) {}
32+
systems;
33+
34+
systems = [
35+
"aarch64-darwin"
36+
"aarch64-linux"
37+
"x86_64-darwin"
38+
"x86_64-linux"
39+
];
40+
in
2841
{
2942
flakeModule = ./flake-module.nix;
3043

@@ -36,7 +49,7 @@
3649
overlays.default = self.overlays.topology;
3750
overlays.topology = import ./pkgs/default.nix;
3851
}
39-
// flake-utils.lib.eachDefaultSystem (system: rec {
52+
// eachSystem systems (system: rec {
4053
pkgs = import nixpkgs {
4154
inherit system;
4255
overlays = [

pkgs/docs.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
flakeForExample = path: let
4141
self = (import (path + "/flake.nix")).outputs {
42-
inherit (flakeInputs) nixpkgs flake-utils;
42+
inherit (flakeInputs) nixpkgs;
4343
inherit self;
4444
nix-topology = flakeOutputs // {outPath = ./..;};
4545
};

0 commit comments

Comments
 (0)