When I tried running home-manager switch today I was met with
error: The unique option `xsession.windowManager.i3.config.keybindings.Mod4+Return' is defined multiple times, in `/nix/store/zkqd8z8a0l9jrm0ba5d3g707ild5aqwg-master.tar.gz/modules/services/window-managers/i3.nix' and `/home/daniel/.config/nixpkgs/nix-dotfiles/home.nix'.
(use '--show-trace' to show detailed location information)
I'd think that the home.nix would override the default home-manager config.
xsession = {
enable = true;
windowManager = {
i3.enable = true;
i3.config = {
modifier = "Mod4";
keybindings = let modifier = "Mod4"; #xsession.windowManager.i3.config.modifier;
in lib.mkOptionDefault {
"${modifier}+0" = "workspace 10";
"${modifier}+Tab" = "workspace next";
"${modifier}+Shift+Tab" = "workspace prev";
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +5%";
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -5%";
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute 0 toggle";
"XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute 1 toggle";
"XF86MonBrightnessUp" = "exec --no-startup-id xbacklight -inc 5";
"XF86MonBrightnessDown" = "exec --no-startup-id xbacklight -dec 5";
"XF86Display" = "exec arandr";
"Print" = "exec scrot %Y-%m-%d_$wx$h_scrot.png -z -e 'mv $f /home/daniel/Pictures/screenshots/'";
"${modifier}+Print" = "exec scrot %Y-%m-%d_$wx$h_scrot.png -z -e 'mv $f /home/daniel/Pictures/screenshots/'";
"${modifier}+n" = "exec dolphin";
"${modifier}+b" = "exec firefox";
"${modifier}+t" = "exec gedit";
"${modifier}+Return" = "exec i3-sensible-terminal -e zsh";
"${modifier}+Shift+Return" = "exec i3-sensible-terminal -e ssh daniel@adam";
};
};
};
};
Hmm, you are using mkOptionDefault? Howcome? If you use mkDefault instead or leave it oh all together then I think it should work OK 馃槂
On December 6, 2018 10:16:42 PM GMT+01:00, "Daniel L酶vbr酶tte Olsen" notifications@github.com wrote:
When I tried running home-manager switch today I was met with
error: The unique option `xsession.windowManager.i3.config.keybindings.Mod4+Return' is defined multiple times, in `/nix/store/zkqd8z8a0l9jrm0ba5d3g707ild5aqwg-master.tar.gz/modules/services/window-managers/i3.nix' and `/home/daniel/.config/nixpkgs/nix-dotfiles/home.nix'. (use '--show-trace' to show detailed location information)I'd think that the home.nix would override the default home-manager
config.xsession = { enable = true; windowManager = { i3.enable = true; i3.config = { modifier = "Mod4"; keybindings = let modifier = "Mod4"; #xsession.windowManager.i3.config.modifier; in lib.mkOptionDefault { "${modifier}+0" = "workspace 10"; "${modifier}+Tab" = "workspace next"; "${modifier}+Shift+Tab" = "workspace prev"; "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +5%"; "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -5%"; "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute 0 toggle"; "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute 1 toggle"; "XF86MonBrightnessUp" = "exec --no-startup-id xbacklight -inc 5"; "XF86MonBrightnessDown" = "exec --no-startup-id xbacklight -dec 5"; "XF86Display" = "exec arandr"; "Print" = "exec scrot %Y-%m-%d_$wx$h_scrot.png -z -e 'mv $f /home/daniel/Pictures/screenshots/'"; "${modifier}+Print" = "exec scrot %Y-%m-%d_$wx$h_scrot.png -z -e 'mv $f /home/daniel/Pictures/screenshots/'"; "${modifier}+n" = "exec dolphin"; "${modifier}+b" = "exec firefox"; "${modifier}+t" = "exec gedit"; "${modifier}+Return" = "exec i3-sensible-terminal -e zsh"; "${modifier}+Shift+Return" = "exec i3-sensible-terminal -e ssh daniel@adam"; }; }; }; };--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rycee/home-manager/issues/485
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
The example in the manual is
modifier = xsession.windowManager.i3.config.modifier;
in
lib.mkOptionDefault {
"${modifier}+Return" = "exec i3-sensible-terminal";
"${modifier}+Shift+q" = "kill";
"${modifier}+d" = "exec \${pkgs.dmenu}/bin/dmenu_run";
}
so I just copied that :)
but yes MkDefault worked thanks!
And also just not having it :smile:
Ah, yeah! The example will need a bit of rethinking. Glad it worked out for you 馃槂 Please leave the ticket open, though. I'll have a look at this at some later point. @uvNikita This might be interesting for you as well.
On December 6, 2018 10:31:30 PM GMT+01:00, "Daniel L酶vbr酶tte Olsen" notifications@github.com wrote:
The example in the manual is
modifier = xsession.windowManager.i3.config.modifier; in lib.mkOptionDefault { "${modifier}+Return" = "exec i3-sensible-terminal"; "${modifier}+Shift+q" = "kill"; "${modifier}+d" = "exec \${pkgs.dmenu}/bin/dmenu_run"; }so I just copied that :)
but yes MkDefault worked thanks!
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/rycee/home-manager/issues/485#issuecomment-445036734
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
yeah actually I didn't test that enough sorry ^^
mkOption and leaving it empty makes it override the entire setting, so the default keybindings don't work. :confused:
Yeah, I think home.nix should be able to redefine keybindings. Right now, I guess you have to add lib.mkForce for every override you are making, which is not a nice user experience. E.g. something like this should work:
"${modifier}+Tab" = lib.mkForce "workspace next";
My guess is that to fix this, we would have to add mkDefault to every keybinding defined in the i3 module.
This used to work btw, it just broke during the past month or so.
but I'll try your workaround for now
EDIT:
Using lib.mkOptionDefault and lib.mkForce like above did work
@dali99 yes, I think this commit changed the behavior: https://github.com/rycee/home-manager/commit/c108eaba425cccf7512e02f173043ee2fb536f85.
I created a PR that should fix this issue, so lib.mkForce will not be needed.
Most helpful comment
I created a PR that should fix this issue, so lib.mkForce will not be needed.