Compare commits

...

1 commit

Author SHA1 Message Date
1b71633b9b
feat: use per device monitor configuration 2024-11-29 10:58:20 +01:00
5 changed files with 78 additions and 11 deletions

View file

@ -6,6 +6,9 @@
osConfig, osConfig,
... ...
}: }:
let
inherit (lib) mapAttrs;
in
lib.mkIf osConfig.programs.sway.enable { lib.mkIf osConfig.programs.sway.enable {
services.swayidle.enable = true; services.swayidle.enable = true;
@ -199,14 +202,12 @@ lib.mkIf osConfig.programs.sway.enable {
}; };
#: }}} #: }}}
#: Output {{{ #: Output {{{
output = { output = mapAttrs (name: value: {
eDP-1 = { scale = toString value.scale;
scale = "2"; pos = "${toString value.posX} ${toString value.posY}";
pos = "0 0"; res = "${toString value.resX}x${toString value.resY}";
res = "3840x2400"; adaptive_sync = "on";
adaptive_sync = "on"; }) osConfig.modules.system.outputs;
};
};
#: }}} #: }}}
}; };
}; };

View file

@ -32,9 +32,23 @@
}; };
modules = { modules = {
system.networking = { system = {
wifi.enable = true; outputs = {
bluetooth.enable = true; "DP-2" = {
resX = 1920;
resY = 1080;
};
"HDMI-A-1" = {
posX = 1920;
resX = 1920;
resY = 1080;
};
};
networking = {
wifi.enable = true;
bluetooth.enable = true;
};
}; };
services = { services = {
@ -81,6 +95,7 @@
firefox.enable = true; firefox.enable = true;
thunderbird.enable = true; thunderbird.enable = true;
sway.enable = true; sway.enable = true;
hyprland.enable = true;
}; };
security.polkit.enable = true; security.polkit.enable = true;

View file

@ -17,6 +17,13 @@
media.enableAll = true; media.enableAll = true;
system = { system = {
outputs = {
eDP-1 = {
resX = 3840;
resY = 2400;
scale = 2.0;
};
};
networking = { networking = {
bluetooth.enable = true; bluetooth.enable = true;
wifi.enable = true; wifi.enable = true;

View file

@ -2,5 +2,6 @@
imports = [ imports = [
./networking ./networking
./roles ./roles
./outputs.nix
]; ];
} }

View file

@ -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 = { };
};
}