2025-01-30 18:17:53 +00:00
|
|
|
# flake-parts module {#sec-flakes-flake-parts-module}
|
|
|
|
|
|
|
|
When using [flake-parts](https://flake.parts)
|
2025-01-30 23:22:29 +01:00
|
|
|
you may wish to import Home Manager's flake module,
|
2025-01-30 18:17:53 +00:00
|
|
|
`flakeModules.home-manager`.
|
|
|
|
|
|
|
|
``` nix
|
|
|
|
{
|
|
|
|
description = "flake-parts configuration";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = inputs@{ flake-parts, ... }:
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
|
|
imports = [
|
|
|
|
# Import home-manager's flake module
|
|
|
|
inputs.home-manager.flakeModules.home-manager
|
|
|
|
];
|
|
|
|
flake = {
|
2025-02-03 16:19:46 -03:00
|
|
|
# Define `homeManagerModules`, `homeConfigurations`,
|
2025-01-30 18:17:53 +00:00
|
|
|
# `nixosConfigurations`, etc here
|
|
|
|
};
|
|
|
|
# See flake.parts for more features, such as `perSystem`
|
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2025-02-03 16:19:46 -03:00
|
|
|
The flake module defines the `flake.homeManagerModules` and `flake.homeConfigurations`
|
2025-01-30 18:17:53 +00:00
|
|
|
options, allowing them to be properly merged if they are defined in multiple
|
|
|
|
modules.
|
|
|
|
|
2025-02-03 16:19:46 -03:00
|
|
|
If you are only defining `homeManagerModules` and/or `homeConfigurations` once in a
|
2025-01-30 18:17:53 +00:00
|
|
|
single module, flake-parts should work fine without importing
|
|
|
|
`flakeModules.home-manager`.
|