diff --git a/home/sway/default.nix b/home/sway/default.nix index b0f41b5..cbf8ebb 100644 --- a/home/sway/default.nix +++ b/home/sway/default.nix @@ -6,6 +6,9 @@ osConfig, ... }: +let + inherit (lib) mapAttrs; +in lib.mkIf osConfig.programs.sway.enable { services.swayidle.enable = true; @@ -199,14 +202,12 @@ lib.mkIf osConfig.programs.sway.enable { }; #: }}} #: Output {{{ - output = { - eDP-1 = { - scale = "2"; - pos = "0 0"; - res = "3840x2400"; - adaptive_sync = "on"; - }; - }; + output = mapAttrs (name: value: { + scale = toString value.scale; + pos = "${toString value.posX} ${toString value.posY}"; + res = "${toString value.resX}x${toString value.resY}"; + adaptive_sync = "on"; + }) osConfig.modules.system.outputs; #: }}} }; }; diff --git a/hosts/brontes/default.nix b/hosts/brontes/default.nix index cd6be3b..b22d27a 100644 --- a/hosts/brontes/default.nix +++ b/hosts/brontes/default.nix @@ -32,9 +32,23 @@ }; modules = { - system.networking = { - wifi.enable = true; - bluetooth.enable = true; + system = { + outputs = { + "DP-2" = { + resX = 1920; + resY = 1080; + }; + "HDMI-A-1" = { + posX = 1920; + resX = 1920; + resY = 1080; + }; + }; + + networking = { + wifi.enable = true; + bluetooth.enable = true; + }; }; services = { @@ -81,6 +95,7 @@ firefox.enable = true; thunderbird.enable = true; sway.enable = true; + hyprland.enable = true; }; security.polkit.enable = true; diff --git a/hosts/marr/default.nix b/hosts/marr/default.nix index 3dc68f0..d4d782b 100644 --- a/hosts/marr/default.nix +++ b/hosts/marr/default.nix @@ -17,6 +17,13 @@ media.enableAll = true; system = { + outputs = { + eDP-1 = { + resX = 3840; + resY = 2400; + scale = 2.0; + }; + }; networking = { bluetooth.enable = true; wifi.enable = true; diff --git a/options/system/default.nix b/options/system/default.nix index 234023c..9a83083 100644 --- a/options/system/default.nix +++ b/options/system/default.nix @@ -2,5 +2,6 @@ imports = [ ./networking ./roles + ./outputs.nix ]; } diff --git a/options/system/outputs.nix b/options/system/outputs.nix new file mode 100644 index 0000000..93cdd48 --- /dev/null +++ b/options/system/outputs.nix @@ -0,0 +1,43 @@ +{ lib, ... }: +let + inherit (lib) mkOption; + inherit (lib.types) + attrsOf + submodule + int + float + str + ; +in +{ + options.modules.system.outputs = mkOption { + type = attrsOf ( + submodule ( + { name, config, ... }: + { + options = { + name = mkOption { + type = str; + default = name; + }; + scale = mkOption { + type = float; + default = 1.0; + }; + posX = mkOption { + type = int; + default = 0; + }; + posY = mkOption { + type = int; + default = 0; + }; + resX = mkOption { type = int; }; + resY = mkOption { type = int; }; + }; + } + ) + ); + default = { }; + }; +}