diff --git a/nix/homes/rafiq/desktop/default.nix b/nix/homes/rafiq/desktop/default.nix index e3e4ef3..9eb1fc4 100644 --- a/nix/homes/rafiq/desktop/default.nix +++ b/nix/homes/rafiq/desktop/default.nix @@ -65,6 +65,7 @@ in pkgs, config, hostName, + hostConfig, ... }: let @@ -250,17 +251,20 @@ in # Null the packages since we use them system wide package = null; portalPackage = null; - # settings.monitor = [ - # "${mainMonitor.id}, ${mainMonitor.resolution}@${mainMonitor.refresh-rate}, auto, ${mainMonitor.scale}" - # ]; - settings = mkMerge [ (import ./_hyprland/decoration.nix) (import ./_hyprland/keybinds.nix { inherit pkgs; }) { ecosystem.no_update_news = true; xwayland.force_zero_scaling = true; - monitor = [ ", preferred, auto, 1" ]; + monitor = + let + mainMonitor = hostConfig.machine.monitors.main; + in + [ + "${mainMonitor.id}, ${mainMonitor.resolution}@${mainMonitor.refresh-rate}, auto, ${mainMonitor.scale}" + ", preferred, auto, 1" + ]; exec-once = [ "uwsm app -- $LOCKSCREEN" "uwsm app -- $NOTIFICATION_DAEMON" diff --git a/nix/manifest.nix b/nix/manifest.nix index aa91702..4479b14 100644 --- a/nix/manifest.nix +++ b/nix/manifest.nix @@ -14,14 +14,12 @@ platform = "amd"; gpu = "nvidia"; root.drive = "/dev/disk/by-id/nvme-CT2000P3SSD8_2325E6E77434"; - monitors = [ - { - id = "desc:OOO AN-270W04K"; - scale = "2"; - resolution = "3840x2160"; - refresh-rate = "60"; - } - ]; + monitors.main = { + id = "desc:OOO AN-270W04K"; + resolution = "3840x2160"; + refresh-rate = "60"; + scale = "2"; + }; }; extraCfg.server.web-apps = { comfy-ui.enable = true; diff --git a/nix/meta.nix b/nix/meta.nix index 5fee0c7..0d95bd7 100644 --- a/nix/meta.nix +++ b/nix/meta.nix @@ -8,7 +8,6 @@ let inherit (lib.options) mkOption mkEnableOption; inherit (cfg.lib.options) mkStrOption; inherit (lib.types) - listOf path lazyAttrsOf raw @@ -18,6 +17,14 @@ let inherit (inputs.flake-parts.lib) mkSubmoduleOptions; inherit (cfg.lib.attrsets) firstAttrNameMatching; cfg = config.flake; + monitorOpts = submodule { + options = { + id = mkStrOption ""; + resolution = mkStrOption ""; + refresh-rate = mkStrOption ""; + scale = mkStrOption ""; + }; + }; userOpts = submodule { options = { username = mkStrOption ""; @@ -36,14 +43,8 @@ let gpu = mkStrOption ""; root.drive = mkStrOption ""; monitors = mkOption { - type = listOf submodule { - options = { - id = mkStrOption ""; - scale = mkStrOption ""; - resolution = mkStrOption ""; - refresh-rate = mkStrOption ""; - }; - }; + type = lazyAttrsOf monitorOpts; + default = { }; }; }; extraCfg = mkOption {