I have a flake where my mac uses home manager modules in a darwin config. I am stuck on how to refactor the “home-manager.darwinModules.home-manager” inline module fully into a separate file (./home/jeffwindsor.nix). I would like to have a modules list that looks like this:
modules = [
./home/jeffwindsor.nix
./machine/macbook_m.nix
./desktop/aqua.nix
mac-app
];
but I seem to not grasp how to accomplish this. Any help is very much appreciated.
My current config:
flake.nix
{
description = "jeff.windsor";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
mac-app-util.url = "github:hraban/mac-app-util";
};
outputs = inputs:
let
ds = inputs.nix-darwin.lib.darwinSystem;
home = inputs.home-manager.darwinModules.home-manager;
mac-app = inputs.mac-app-util.darwinModules.default;
in
{
darwinConfigurations."Midnight-Air" = ds {
modules = [
home {
users.users.jeffwindsor = {
name = "Jeff Windsor";
home = "/Users/jeffwindsor";
};
home-manager.users.jeffwindsor = import ./home/jeffwindsor.nix;
}
./machine/macbook_m.nix
./desktop/aqua.nix
mac-app
];
};
};
}
separate file
{ ... }: {
imports = [ ./module/eza.nix ];
home.shell = {
enableZshIntegration = true;
enableNushellIntegration = true;
};
home.stateVersion = "25.05";
}