2022-12-04 13:45:43 +00:00
|
|
|
{
|
2023-09-18 03:56:58 +01:00
|
|
|
self,
|
2022-12-04 13:45:43 +00:00
|
|
|
inputs,
|
|
|
|
tree,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-09-01 01:46:14 +01:00
|
|
|
}: let
|
|
|
|
inherit (lib.modules) mkIf;
|
|
|
|
inherit (lib.lists) flatten forEach;
|
|
|
|
inherit (lib.options) mkOption;
|
|
|
|
inherit (lib.types) attrsOf submoduleWith;
|
|
|
|
in {
|
2021-12-20 23:48:26 +00:00
|
|
|
options.home-manager.users = mkOption {
|
2023-09-01 01:46:14 +01:00
|
|
|
type = attrsOf (submoduleWith {
|
2022-12-04 13:45:43 +00:00
|
|
|
modules = [];
|
2021-12-20 23:48:26 +00:00
|
|
|
specialArgs = {
|
2023-09-18 03:56:58 +01:00
|
|
|
inherit inputs tree self;
|
2021-12-20 23:48:26 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
2024-07-24 15:11:46 +01:00
|
|
|
|
2021-12-20 23:48:26 +00:00
|
|
|
config = {
|
|
|
|
home-manager = {
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
useUserPackages = true;
|
2024-07-24 17:48:59 +01:00
|
|
|
sharedModules = with tree; [];
|
2021-12-20 23:48:26 +00:00
|
|
|
};
|
2023-09-01 01:46:14 +01:00
|
|
|
systemd.tmpfiles.rules = mkIf config.boot.isContainer (flatten (forEach (builtins.attrNames config.home-manager.users) (user: [
|
2022-12-15 14:33:39 +00:00
|
|
|
"d /nix/var/nix/profiles/per-user/${user} - ${config.users.users."${user}".group} - - -"
|
|
|
|
"d /nix/var/nix/gcroots/per-user/${user} - ${config.users.users."${user}".group} - - -"
|
|
|
|
])));
|
2021-12-20 23:48:26 +00:00
|
|
|
};
|
|
|
|
}
|