xremap / nix-flake

MIT License
38 stars 10 forks source link

error: Xremap's config needs to be specified either in .yamlConfig or in .config when using both home manager and nixos modules #73

Open UnclePsymon opened 1 month ago

UnclePsymon commented 1 month ago

Hi! After rebuilding my system I get this error:

error:
       … while calling the 'head' builtin

         at /nix/store/lzhqf5y9dcgfkg5f7f96jjc814pgrsqy-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/lzhqf5y9dcgfkg5f7f96jjc814pgrsqy-source/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: Xremap's config needs to be specified either in .yamlConfig or in .config

This is from my configuration.nix:

 imports = [
    ./hardware-configuration.nix
    inputs.home-manager.nixosModules.default
    inputs.xremap-flake.nixosModules.default
];

  services.xremap = {
    enable = true;
    withX11 = true;
    serviceMode = "user";
    userName = "simon";
    config = {
      keymap = [
        {
          name = "Main";
          remap = {
            super-o = {
              launch = ["obsidian"];
            };
            name = "Kitty";
            remap = {
              super-c = {
                launch = ["kitty"];
              };
            };
          };
        }
      ];
    };
  };

I tried many variations of my configuration, but i always get this error message. So i tried this as well:

  services.xremap = {
    serviceMode = "user";
    userName = "simon";
    config = {
      modmap = [
        {
          name = "Global";
          remap = {"CapsLock" = "Esc";}; # globally remap CapsLock to Esc
        }
      ];
      keymap = [
        {
          name = "apps";
          remap.alt-p.launch = ["firefox"];
        }
        {
          name = "Example ctrl-u > pageup rebind";
          remap = {"C-p" = "PAGEUP";};
        }
      ];
    };
  };

Isn't this the required .config? Or did I miss something important? Thank you ❤️

UnclePsymon commented 1 month ago

Oopsie! I had the nixos module and the home-manager module imported at the same time. I removed the home-manager module and now it is working! Thx again ❤️

VTimofeenko commented 1 month ago

I'd like to have a less confusing error message for this so reopening