How import module from GitHub into Home Manager config?

Good day,

I’m starting with Home Manager and would like to use plasma module but I can’t find any examples on how to add custom modules into home-manager through adding them directly from git. The author provides a flake example but I’m still learning Nix and trying to minimize the amount of things I need to learn hence not embracing flakes yet.

My current home manager config is minimalistic as in the below and is simply imported into configuration.nix.
How can I add plasma module to it?

{ config, pkgs, ... }:

{

  imports = [
    <home-manager/nixos>
  ];
  
  home-manager.useUserPackages = true;
  home-manager.useGlobalPkgs = true;

  home-manager.users.foo = { pkgs, ... }: {
    home.stateVersion = "21.11";
    home.packages = with pkgs; [
        zoom-us
    ];
    programs.bash.enable = true;
    programs.direnv.enable = true;

  };

}

I’m on NixOS 22.11 on amd64.

Hi, I’ve discovered the module from your post. I haven’t got it to work fully, but Peter’s config - tilde/flake.nix at ca2dbdb3e8cf05300002692221c3b6802cdf5af9 · pjones/tilde · GitHub may help…

I get the following error which means nothing to me!

error: attribute ‘hm’ missing

   at /nix/store/p5v25rcwc1jxwyprgc5rck3y6x755i68-source/modules/files.nix:55:40:

       54|   config = lib.mkIf (builtins.length (builtins.attrNames cfg) > 0) {
       55|     home.activation.configure-plasma = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
         |                                        ^
       56|       $DRY_RUN_CMD ${script}
   Did you mean one of id or or?

Yeah, Peter’s examples use flakes. Getting the same error trying to import this module from the cloned directory:

  imports = [
    <home-manager/nixos>
    /home/foo/plasma-manager/modules
  ];

Opened a GH issue How to use without flakes? · Issue #19 · pjones/plasma-manager · GitHub

Hope you get an answer - there seems to be some subtle issues with the config of this module - I found a fix for the flake issue I highlighted above (How to use it in home.nix ? · Issue #14 · pjones/plasma-manager · GitHub) which I would not have considered.

Regarding flakes - I found the basics were OK so I could get something to work. As you do more, I found that there is becoming more info and examples with flakes. I have been using flakes for a few months now and I feel that is easier to progress. I also use the unstable branch, which seems more robust to me than 22.1 did, and any issues often get fixed more quickly due to the rolling approach.

The module author has eventually helped me. Here is the solution: link