diff --git a/hosts/vali/hermit/default.nix b/hosts/vali/hermit/default.nix index 4b93ee2..0312dc8 100644 --- a/hosts/vali/hermit/default.nix +++ b/hosts/vali/hermit/default.nix @@ -3,5 +3,6 @@ _: { ./configuration.nix ./programs.nix ./hardware-configuration.nix + ./hardware ]; } diff --git a/hosts/vali/hermit/hardware/default.nix b/hosts/vali/hermit/hardware/default.nix new file mode 100644 index 0000000..715273e --- /dev/null +++ b/hosts/vali/hermit/hardware/default.nix @@ -0,0 +1 @@ +_: {imports = [./monitors.nix];} diff --git a/hosts/vali/hermit/hardware/fs.nix b/hosts/vali/hermit/hardware/fs.nix new file mode 100644 index 0000000..e69de29 diff --git a/hosts/vali/hermit/hardware/monitors.nix b/hosts/vali/hermit/hardware/monitors.nix new file mode 100644 index 0000000..09f3a5a --- /dev/null +++ b/hosts/vali/hermit/hardware/monitors.nix @@ -0,0 +1,18 @@ +_: { + modules.system.hardware.monitors = [ + { + name = "Integrated laptop screen"; + device = "eDP-1"; + resolution = { + x = 1920; + y = 1080; + }; + scale = 1; + refresh_rate = 60; + position = { + x = 0; + y = 0; + }; + } + ]; +} diff --git a/modules/options/system/monitors.nix b/modules/options/system/monitors.nix index 88154b8..5c73292 100644 --- a/modules/options/system/monitors.nix +++ b/modules/options/system/monitors.nix @@ -1,71 +1,73 @@ -{lib, ...}: -with lib; { - options.modules.other.system.monitors = mkOption { +{lib, ...}: let + inherit (lib) mkOption; + inherit (lib.types) str submodule int ints number listOf; +in { + options.modules.system.monitors = mkOption { description = "\n List of monitors to use\n "; default = []; - type = with types; - types.listOf (submodule { - options = { - name = mkOption { - type = types.str; - description = "Give your monitor a cute name"; - default = "monitor0(I am lazy)"; - }; - device = mkOption { - type = types.str; - description = "The actual device name of the monitor"; - }; - resolution = mkOption { - type = types.submodule { - options = { - x = mkOption { - type = types.int; - description = "monitor width"; - default = "1920"; - }; - y = mkOption { - type = types.int; - description = "monitor height"; - default = "1080"; - }; + type = listOf (submodule { + options = { + name = mkOption { + type = str; + description = "Give your monitor a cute name"; + default = ""; + }; + device = mkOption { + type = str; + description = "The actual device name of the monitor"; + default = "eDP-1"; + }; + resolution = mkOption { + type = submodule { + options = { + x = mkOption { + type = int; + description = "monitor width"; + default = "1920"; + }; + y = mkOption { + type = int; + description = "monitor height"; + default = "1080"; }; }; }; - scale = mkOption { - type = types.number; - description = "monitor scale"; - default = 1.0; - }; - refresh_rate = mkOption { - type = types.int; - description = "monitor refresh rate (in Hz)"; - default = 60; - }; - position = mkOption { - type = types.submodule { - options = { - x = mkOption { - type = types.int; - default = 0; - }; - y = mkOption { - type = types.int; - default = 0; - }; - }; - }; - description = "absolute monitor posititon"; - default = { - x = 0; - y = 0; - }; - }; - transform = mkOption { - type = types.ints.between 0 3; - description = "Rotation of the monitor counterclockwise"; - default = 0; - }; }; - }); + scale = mkOption { + type = number; + description = "monitor scale"; + default = 1.0; + }; + refresh_rate = mkOption { + type = int; + description = "monitor refresh rate (in Hz)"; + default = 60; + }; + position = mkOption { + type = submodule { + options = { + x = mkOption { + type = int; + default = 0; + }; + y = mkOption { + type = int; + default = 0; + }; + }; + }; + description = "absolute monitor posititon"; + default = { + x = 0; + y = 0; + }; + }; + transform = mkOption { + type = ints.between 0 3; + description = "Rotation of the monitor counterclockwise"; + default = 0; + }; + }; + }); }; } diff --git a/modules/wms/wayland/hypr/land.nix b/modules/wms/wayland/hypr/land.nix index a3c2bee..aede6df 100644 --- a/modules/wms/wayland/hypr/land.nix +++ b/modules/wms/wayland/hypr/land.nix @@ -8,6 +8,7 @@ cfg = config.modules.usrEnv.desktops.hyprland; inherit (config.modules.other.system) username; inherit (config.modules.style) cursor; + inherit (config.modules.hardware) monitors; inherit (inputs'.split-monitor-workspaces.packages) @@ -58,14 +59,21 @@ in { "$mainMod" = "SUPER"; # Monitor config - monitor = [ - "eDP-1,1920x1080,0x0,1" - # "DP-2,1920x1080,0x0,1" - # "HDMI-A-2,1920x1080,1920x0,1" - # "HDMI-A-1,1920x1080,3840x0,1" - # Had the shadow monitor bug, so had to disable all unknown monitors. - "Unknown-1,disable" - ]; + # monitor = [ + # "eDP-1,1920x1080,0x0,1" + # # "DP-2,1920x1080,0x0,1" + # # "HDMI-A-2,1920x1080,1920x0,1" + # # "HDMI-A-1,1920x1080,3840x0,1" + # # Had the shadow monitor bug, so had to disable all unknown monitors. + # "Unknown-1,disable" + # ]; + + monitor = + map ( + m: "${m.device},${toString m.resolution.x}x${toString m.resolution.y}@${toString m.refresh_rate},${toString m.position.x}x${toString m.position.y},${toString m.scale},transform,${toString m.transform}" + ) + monitors; #TODO: default value + # Workspace config workspace = [ "1,monitor:eDP-1, default:true" @@ -163,7 +171,7 @@ in { ]; # Hyprland anomations, using the above bezier curves animations = { - enabled = true; + enabled = false; animation = [ "windows, 1, 4, dupa, popin" "windowsOut, 1, 4, dupa, slide"