flake/modules/nixos/core/home.nix
2026-04-13 10:42:58 +00:00

23 lines
858 B
Nix

{ pkgs, lib, config, inputs, system, sources, ... }:
let cfg = config.mods;
in {
options.mods.home.file =
lib.mkOption { description = "home-manager configuration file"; };
config = {
home-manager = {
extraSpecialArgs = { inherit system pkgs inputs sources; };
# When stylix is enabled it injects its own HM module (and followSystem
# copyModules) via homeManagerIntegration.autoImport. Only add it here
# for hosts where stylix is disabled so that stylix options are still
# declared (even if unused) in every home-manager context.
sharedModules = lib.optional (!config.stylix.enable) inputs.stylix.homeModules.stylix;
users."${cfg.user.name}" = {
imports =
[ cfg.home.file inputs.self.outputs.homeManagerModules.default ];
};
backupFileExtension = "bak";
};
};
}