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,
...
}:
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;
#: }}}
};
};

View file

@ -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;

View file

@ -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;

View file

@ -2,5 +2,6 @@
imports = [
./networking
./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 = { };
};
}