@@ 35,13 35,17 @@ in {
};
packages = lib.mkOption {
- type = lib.types.listOf (lib.types.oneOf [lib.types.package lib.types.str]);
+ type = lib.types.listOf lib.types.package;
default = [];
};
homeFilesPackage = lib.mkOption {
type = lib.types.package;
};
+
+ path = lib.mkOption {
+ type = lib.types.package;
+ };
};
};
@@ 50,25 54,21 @@ in {
tmpfiles.defaultUser = config.home.user;
tmpfiles.defaultGroup = config.home.group;
- home.file = builtins.listToAttrs (builtins.map (pkg:
- # lib.nameValuePair (".local/bin/${pkg.meta.mainProgram}")
- # { executable = true; source = lib.getExe pkg; }
- # )
- if lib.isDerivation pkg then
- lib.nameValuePair ".local/bin/${pkg.meta.mainProgram}"
- {
- source = lib.getExe pkg;
- executable = true;
- }
- else
- lib.nameValuePair (builtins.unsafeDiscardStringContext ".local/bin/${builtins.baseNameOf pkg}")
- {
- source = pkg;
- executable = true;
- })
- config.home.packages);
-
- tmpfiles.instances.home.files = (lib.attrValues (lib.mapAttrs (name: conf: {
+ home.path = pkgs.buildEnv {
+ name = "tmpactivator-profile";
+ paths = config.home.packages;
+ };
+
+ tmpfiles.instances.home.files = [
+ {
+ type = "L+";
+ mode = "-";
+ user = "-";
+ group = "-";
+ text = "${config.home.path}";
+ target = "${config.home.homeDirectory}/.tmpactivator-profile";
+ }
+ ] ++ (lib.attrValues (lib.mapAttrs (name: conf: {
type = "L+";
mode = "-";
user = "-";