Skip to content

Commit 0e02f8a

Browse files
authored
Merge pull request #543 from luisnquin/refactor/replace-flake-utils-with-systems
refactor(flake): replace flake-utils with nix-systems
2 parents 7efd8bc + 6e92afd commit 0e02f8a

File tree

2 files changed

+18
-30
lines changed

2 files changed

+18
-30
lines changed

flake.lock

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

flake.nix

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
{
22
inputs = {
33
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4-
flake-utils = { url = "github:numtide/flake-utils"; };
4+
systems.url = "github:nix-systems/default";
55
};
6-
outputs = { nixpkgs, flake-utils, ... }:
7-
(flake-utils.lib.eachDefaultSystem (system:
8-
let pkgs = nixpkgs.legacyPackages.${system};
9-
in {
10-
devShells.default = pkgs.mkShell {
6+
outputs = { nixpkgs, systems, ... }:
7+
let
8+
forAllSystems = function:
9+
nixpkgs.lib.genAttrs (import systems) (
10+
system: function nixpkgs.legacyPackages.${system}
11+
);
12+
in
13+
{
14+
devShells = forAllSystems (pkgs: {
15+
default = pkgs.mkShell {
1116
name = "Shell with Go toolchain";
1217
packages = with pkgs; [ go gopls ];
1318
};
14-
})) // {
15-
nixosModules.default = import ./nix/nixos.nix;
16-
hmModules.default = import ./nix/home-manager.nix;
17-
};
19+
});
20+
21+
nixosModules.default = import ./nix/nixos.nix;
22+
hmModules.default = import ./nix/home-manager.nix;
23+
};
1824
}

0 commit comments

Comments
 (0)