diff --git a/hardware/displays.nix b/hardware/displays.nix index 348c73c..4efceaf 100644 --- a/hardware/displays.nix +++ b/hardware/displays.nix @@ -8,13 +8,20 @@ name = "DP-1"; description = "HP Inc. HP 24x 1CR9500W9Q"; resolution = { x = 1920; y = 1080; freq = 144; }; - position = "0x0"; + position.x = 0; + position.y = 0; + wallpaper = "/home/tristan/Pictures/backgrounds/demonslayer.jpg"; + } + { + name = "HDMI-A-1"; + resolution = {x=1920;y=1080;freq=60;}; + wallpaper = "/home/tristan/Pictures/backgrounds/nier.jpg"; } { name = "eDP-1"; description = "BOE 0x07D8"; scaling = 1.2; - position = "0x1080"; + position.y = 1080; wallpaper = "/home/tristan/Pictures/backgrounds/nix-wallpaper-watersplash.png"; } ]; diff --git a/hardware/zenix.nix b/hardware/zenix.nix index f96e4e1..77c2ae9 100644 --- a/hardware/zenix.nix +++ b/hardware/zenix.nix @@ -7,6 +7,7 @@ imports = [ (modulesPath + "/installer/scan/not-detected.nix") + ./displays.nix ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; @@ -67,22 +68,6 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - displays = { - enable = true; - displays = [ - { - name = "DP-1"; - resolution = {x=1920;y=1080;freq=144;}; - wallpaper = "~/Pictures/backgrounds/demonslayer.jpg"; - } - { - name = "HDMI-A-1"; - resolution = {x=1920;y=1080;freq=60;}; - wallpaper = "~/Pictures/backgrounds/nier.jpg"; - } - ]; - }; - hardware.keyboard.zsa.enable = true; services.tlp = { diff --git a/lib/modules/display.nix b/lib/modules/display.nix index bcdf7c1..2f7e3af 100644 --- a/lib/modules/display.nix +++ b/lib/modules/display.nix @@ -36,7 +36,7 @@ let else "desc:" + display.description; positionToHyprlandString = { x, y }: - if (x == "" || y == "") then "auto" else x + "x" + y; + if (x == -1 || y == -1) then "auto" else toString x + "x" + toString y; renderDisplaysForSway = displays: listToAttrs (map displaySwaySetting displays); @@ -45,7 +45,7 @@ let name = display.name; value = let res = display.resolution; in { - mode = mkIf (resIsSet res) + mode = mkIf (!resUnset res) "${toString res.x}x${toString res.y}@${toString res.freq}Hz"; bg = display.wallpaper + " fill"; scale = toString display.scaling; @@ -92,10 +92,12 @@ let default = { }; }; position.x = mkOption { - default = ""; + default = -1; + type = types.int; }; position.y = mkOption { - default = ""; + default = -1; + type = types.int; }; wallpaper = mkOption { description = "path to wallpaper"; @@ -104,11 +106,11 @@ let }; }); - resIsSet = res: - !(res.x == 0 || res.y == 0 || res.freq == 0); + resUnset = res: + (res.x == 0 || res.y == 0 || res.freq == 0); resToString = res: - if resIsSet res + if resUnset res then "preferred" else "${toString res.x}x${toString res.y}@${toString res.freq}"; diff --git a/lib/modules/personal.nix b/lib/modules/personal.nix index 6f19de2..020de5f 100644 --- a/lib/modules/personal.nix +++ b/lib/modules/personal.nix @@ -27,6 +27,7 @@ with lib; handbrake monero-gui xmrig + transmission-remote-gtk krita ]; }]; diff --git a/system/global/home.nix b/system/global/home.nix index e219d5b..fddf51f 100644 --- a/system/global/home.nix +++ b/system/global/home.nix @@ -377,6 +377,10 @@ in user = "git"; port = 2222; }; + "alpine" = { + hostname = "100.116.82.65"; + user = "tristan"; + }; }; programs.neovim.defaultEditor = true;