Hello,
Technically, there are two issues. Not sure if I need to split these out.
Here is the hyprland nix config section:
{ inputs, config, lib, pkgs, modulesPath, homeManager, ... }:
{
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = true;
settings = {
env = [
# Hint Electron apps to use Wayland
"NIXOS_OZONE_WL,1"
"XDG_CURRENT_DESKTOP,Hyprland"
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"QT_QPA_PLATFORM,wayland"
"XDG_SCREENSHOTS_DIR,$HOME/screens"
];
# if hostname = "bqnix"
monitor = "DP-6,preferred,auto,auto";
# if hostname = "tbnix"
# monitor = "eDP-1,1920x1080@60,2560x0,1";
# monitor = "DP-2, 2560x1440@60,0x0,1";
Issue #1: I would like to set up this nix file so that if the hostname = “bqnix”, use the first monitor config. If hostname = “tbnix”, use the commented out section.
I can probably take the easy way out and make duplicate files, one for “bqnix” and another for “tbnix”, but maybe there is a cleaner way to do this in line.
Issue #2: How do you specify multiple monitors in home manager hyprland config? If I comment out DP-6 monitor and uncomment eDP-1 and DP-2 I get this error:
error: attribute 'monitor' already defined at /nix/store/z353hb367clnavz4hbzqfwhz28sqq3hg-source/modules/hyprland/main.nix:22:7
at /nix/store/z353hb367clnavz4hbzqfwhz28sqq3hg-source/modules/hyprland/main.nix:23:7:
22| monitor = "eDP-1,1920x1080@60,2560x0,1";
23| monitor = "DP-2, 2560x1440@60,0x0,1";
| ^
24|
Thanks!