2024-06-30 03:56:48 +03:00
|
|
|
# This is a common user configuration.
|
|
|
|
{ const
|
|
|
|
, util
|
|
|
|
, config
|
|
|
|
, lib
|
|
|
|
, __findFile
|
|
|
|
, ... } @args: with lib; let
|
|
|
|
cfg = config.home.hm;
|
|
|
|
package = import <package> args;
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
home.hm = {
|
|
|
|
enable = mkEnableOption "Home-Manager standalone config.";
|
|
|
|
username = mkOption {
|
|
|
|
default = null;
|
|
|
|
type = types.str;
|
|
|
|
};
|
|
|
|
homeDirectory = mkOption {
|
|
|
|
default = "/home/${cfg.username}";
|
|
|
|
type = types.str;
|
|
|
|
};
|
2024-08-02 23:45:19 +03:00
|
|
|
package = mkOption {
|
2024-06-30 03:56:48 +03:00
|
|
|
default = {};
|
|
|
|
type = types.submodule {
|
|
|
|
options = {
|
2024-08-02 23:45:19 +03:00
|
|
|
android.enable = mkEnableOption "Android apks.";
|
2024-06-30 03:56:48 +03:00
|
|
|
common.enable = mkEnableOption "Common apps.";
|
2024-08-02 23:45:19 +03:00
|
|
|
core.enable = mkEnableOption "Core apps.";
|
2024-06-30 03:56:48 +03:00
|
|
|
creative.enable = mkEnableOption "Creative apps.";
|
2024-08-02 23:45:19 +03:00
|
|
|
desktop.enable = mkEnableOption "Desktop apps.";
|
2024-06-30 03:56:48 +03:00
|
|
|
dev.enable = mkEnableOption "Dev apps.";
|
|
|
|
extra.enable = mkEnableOption "Extra apps.";
|
2024-08-02 23:45:19 +03:00
|
|
|
gaming.enable = mkEnableOption "Gaming apps.";
|
2024-06-30 03:56:48 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable (mkMerge [
|
|
|
|
{
|
|
|
|
home = {
|
|
|
|
inherit (cfg) username homeDirectory;
|
|
|
|
inherit (const) stateVersion;
|
|
|
|
file = import ./config args;
|
|
|
|
sessionVariables = import ./variable args;
|
|
|
|
};
|
|
|
|
xdg = import ./xdg { inherit (cfg) homeDirectory; };
|
|
|
|
programs = import ./program args;
|
|
|
|
dconf.settings = util.catSet (util.ls ./config/dconf) args;
|
|
|
|
}
|
2024-08-02 23:45:19 +03:00
|
|
|
(mkIf cfg.package.android.enable { home.packages = package.android; })
|
|
|
|
(mkIf cfg.package.common.enable { home.packages = package.common; })
|
|
|
|
(mkIf cfg.package.core.enable { home.packages = package.core; })
|
|
|
|
(mkIf cfg.package.creative.enable { home.packages = package.creative; })
|
|
|
|
(mkIf cfg.package.desktop.enable { home.packages = package.desktop; })
|
|
|
|
(mkIf cfg.package.dev.enable { home.packages = package.dev; })
|
|
|
|
(mkIf cfg.package.extra.enable { home.packages = package.extra; })
|
|
|
|
(mkIf cfg.package.gaming.enable { home.packages = package.gaming; })
|
2024-06-30 03:56:48 +03:00
|
|
|
]);
|
|
|
|
}
|