dotfiles

My PC Dotfiles & Website

modules/core/home-manager.nix (1234B)


 1{
 2  lib,
 3  config,
 4  inputs,
 5  ...
 6}: let
 7  inherit (config) util;
 8  inherit (config.flake) files modules;
 9in {
10  options.configurations.homeManager = lib.mkOption {
11    type = lib.types.lazyAttrsOf util.types.configuration;
12    default = {};
13  };
14
15  config.flake.homeConfigurations =
16    lib.mapAttrs (
17      name: {
18        module,
19        system,
20        defaults,
21      }:
22        inputs.home-manager.lib.homeManagerConfiguration {
23          pkgs = config.flake.legacyPackages.${system};
24          extraSpecialArgs = {inherit inputs;};
25          modules =
26            [
27              module
28
29              # Compatibility
30              (
31                {lib, ...}: {
32                  options.home.persistence = lib.mkOption {
33                    type = lib.types.attrsOf lib.types.anything;
34                    default = {};
35                  };
36                }
37              )
38            ]
39            ++
40            # Default Modules
41            lib.optionals defaults [
42              inputs.stylix.homeModules.stylix
43              ({lib, ...}: {stylix.base16Scheme = lib.mkDefault files.colors.catppuccin;})
44              modules.homeManager.default
45            ];
46        }
47    )
48    config.configurations.homeManager;
49}