Skip to content

Commit 9daab62

Browse files
committed
refactor(nix): migrate from flake-utils to flake-parts
Replace flake-utils with flake-parts for a more modular and type-safe Nix flake configuration. flake-parts uses the NixOS module system pattern, providing better extensibility and composability. Key changes: - Replace flake-utils input with flake-parts - Use mkFlake with perSystem pattern instead of eachDefaultSystem - Explicitly declare supported systems (x86_64-linux, aarch64-linux, aarch64-darwin) - Remove x86_64-darwin from supported systems as it is no longer needed Benefits of flake-parts: - NixOS-style module system for flake configuration - Type-safe options with better error messages - Support for advanced features like partitions and flakeModules - More maintainable structure for complex flake configurations
1 parent a9ce5b8 commit 9daab62

2 files changed

Lines changed: 35 additions & 32 deletions

File tree

flake.lock

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

flake.nix

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33

44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6-
flake-utils.url = "github:numtide/flake-utils";
6+
flake-parts.url = "github:hercules-ci/flake-parts";
77
};
88

9-
outputs = { self, nixpkgs, flake-utils }:
10-
flake-utils.lib.eachDefaultSystem (system:
11-
let
12-
pkgs = nixpkgs.legacyPackages.${system};
13-
in
14-
{
9+
outputs = inputs@{ flake-parts, ... }:
10+
flake-parts.lib.mkFlake { inherit inputs; } {
11+
systems = [
12+
"x86_64-linux"
13+
"aarch64-linux"
14+
"aarch64-darwin"
15+
];
16+
17+
perSystem = { pkgs, ... }: {
1518
devShells.default = pkgs.mkShell {
1619
buildInputs = with pkgs; [
1720
pnpm_10
@@ -27,6 +30,6 @@
2730
fi
2831
'';
2932
};
30-
}
31-
);
33+
};
34+
};
3235
}

0 commit comments

Comments
 (0)