nix-community / dconf2nix

:feet: Convert dconf files (e.g. GNOME Shell) to Nix, as expected by Home Manager [maintainer=@jtojnar]
Apache License 2.0
229 stars 6 forks source link

Importing with home-manager module #64

Closed broccoli5 closed 2 years ago

broccoli5 commented 2 years ago

Type of bug

Other (please add details in additional context)

Version

0.0.12

Did you test against master?

Error message (if not timeout)

No response

DConf input

No response

Additional context

So, this is bit awkward, but I use the home-manager nixos module and I do not know how to import the file so that it works, I'm getting:

error: attribute 'hm' missing, at /etc/nixos/config/gnome/dconf.nix:4:6
gvolpe commented 2 years ago

That probably refers to with lib.hm.gvariant;. My guess is you are importing your dconf.nix file directly in your NixOS configuration, so it is picking up the standard lib instead of the one that has the HM modules.

The import should be under home-manager.users.USER. E.g.

{
  home-manager.users.joe = { pkgs, ... }: {
    home.packages = [ pkgs.vim ];
    imports = [ ./dconf.nix ]; 
    programs.bash.enable = true;
  };
}

Do you have something like this in your configuration?

broccoli5 commented 2 years ago

Yep that was it, thanks!

gvolpe commented 2 years ago

@broccoli5 glad to hear!

Since you're fresh on it, mind adding that to the README file? Other users will definitely benefit from that little instruction :)

broccoli5 commented 2 years ago

Yep, I will add it in a little while