Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Jul 24, 2024 · 2 comments

Comments

@UnclePsymon
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor

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

@VTimofeenko VTimofeenko changed the title error: Xremap's config needs to be specified either in .yamlConfig or in .config error: Xremap's config needs to be specified either in .yamlConfig or in .config when using both home manager and nixos modules Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants