nixfiles/profiles/nixos/base/home.nix

35 lines
862 B
Nix
Raw Normal View History

{
2023-09-18 03:56:58 +01:00
self,
inputs,
tree,
config,
lib,
...
}: 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 {
type = attrsOf (submoduleWith {
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
};
systemd.tmpfiles.rules = mkIf config.boot.isContainer (flatten (forEach (builtins.attrNames config.home-manager.users) (user: [
"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
};
}