haios/home/default.nix

55 lines
1.2 KiB
Nix
Raw Normal View History

2025-02-17 22:20:48 +02:00
{
lib,
self,
self',
config,
inputs,
inputs',
...
}: let
inherit (lib.modules) mkIf mkDefault;
inherit (lib.attrsets) genAttrs;
inherit (lib.options) mkEnableOption;
in {
options.olympus.system.useHomeManager =
mkEnableOption "Whether to use home-manager or not"
// {
default = true;
};
config = mkIf config.olympus.system.useHomeManager {
home-manager = {
verbose = true;
useUserPackages = true;
useGlobalPkgs = true;
backupFileExtension = "bak";
users = genAttrs config.olympus.system.users (name: ./${name});
extraSpecialArgs = {
inherit
self
self'
inputs
inputs'
;
};
# we should define grauntied common modules here
sharedModules = [
(self + /modules/home/default.nix)
{
home.stateVersion = config.system.stateVersion;
# reload system units when changing configs
systemd.user.startServices = mkDefault "sd-switch"; # or "legacy" if "sd-switch" breaks again
# let HM manage itself when in standalone mode
programs.home-manager.enable = true;
}
];
};
};
}