@@ 35,7 35,7 @@ in {
};
packages = lib.mkOption {
- type = lib.types.listOf lib.types.package;
+ type = lib.types.listOf (lib.types.oneOf [lib.types.package lib.types.str]);
default = [];
};
@@ 51,11 51,22 @@ in {
tmpfiles.defaultGroup = config.home.group;
home.file = builtins.listToAttrs (builtins.map (pkg:
- lib.nameValuePair (".local/bin/${pkg.meta.mainProgram}") {
- source = (lib.getExe pkg);
- executable = true;
- })
- config.home.packages);
+ # 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.files = (lib.attrValues (lib.mapAttrs (name: conf: {
type = "L+";