~ruther/nix-tmpactivator

26244cda67cbcd5ca03c786a64823274f653fe58 — Rutherther 11 months ago 58dd1f3
feat: allow strings in home.packages
1 files changed, 17 insertions(+), 6 deletions(-)

M modules/home.nix
M modules/home.nix => modules/home.nix +17 -6
@@ 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+";

Do not follow this link