nixfiles/profiles/nixos/base/home.nix

35 lines
892 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;
sharedModules = with tree; [modules.home.vscode-mod-module];
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
};
}